Add alpha channel input for Qwen Image 2.1 and relative docs - #2021
Merged
Merged
Conversation
Contributor
Author
|
Ohh I accidentally pushed 1014d0f here, but if stop building docker images on branches is acceptable I'll just keep it here |
…n.cpp)" This reverts commit 1014d0f.
Owner
|
Thank you for your contribution. |
Contributor
|
I'm noticing the same opaque white patches in the areas that are supposed to transparent in assets/qwen/qwen-image-2.1-alpha-out2.png and in my own attempts at generating transparent images. Is this a flaw of the model in general, or a bug in sd.cpp's implementation in particular? |
Contributor
Author
|
@stduhpf What quantization are you using? |
Contributor
|
Q8_0 |
Contributor
Author
|
I tried the demo on huggingface space which use diffusers directly without quantization. The white patches didn't exist. I'll try F16 on sd.cpp then |
Contributor
Author
Contributor
Author
|
Almost there. Some last tests then I'll come to an answer and open another PR |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Image inputs are no longer force-converted to RGB during decode in the CLI and server; they keep their native channel count. The generation pipeline already normalizes channels per model (
get_image_channels()+ensure_image_tensor_channels()), so RGBA-capable models now receive the alpha channel while RGB-only models are unaffected.Relative docs are also added.
Additional Information
The decoder change affects all image and video input paths. Due to local VRAM limits video generation paths were not exercised locally and should be tested before merging. Theoretically this is not affected.
It seems that sometimes requiring the model to remove background may create some white squares, which I haven't find out the reason yet. Maybe comparing different quantizations (I have no enough VRAM too) or test the results of original
diffuserscould answer this.Checklist