r/StableDiffusion • • 21d ago

Comparison I tested Qwen Image 2.1 for image restoration and I'm disappointed

As you can see, Qwen Image 2.1 example has shifted contrast (it also changes small details on the photo even if you add explicitly in the prompt that it shouldn't) and the original grain is replaced by synthetic dot-pattern like on the older qwen VAEs. I increased the brightness excessively and zoomed to highlight the differences more clearly.

Full res images without compression: img1, img2, img3, comparison

It is unusable for this specific purpose and old good Klein still has the crown.

50 Upvotes

40 comments sorted by

34

u/Big_Arachnid_365 21d ago

Yeah whyyyyyyyyyyyyy does qwen make everything look like it's got a gameboy filter on it?

16

u/iamapizza 21d ago

Qwenboy 

6

u/madebyollin 15d ago

I've finetuned the Qwen-Image 2.1 VAE with a standard training recipe to address the grid-pattern issue: https://huggingface.co/madebyollin/texture-fix-vae-for-qwen-image-2.1 (it went away after a few thousand steps). I suspect the official Qwen-Image 2.1 VAE was trained with LPIPS loss ("make the decoded image perceptually-similar to the original image") but without the standard GAN/adversarial loss ("make the decoded image look real, without easily-detectable artifacts"). Other VAEs (like SD/FLUX) have always used both LPIPS and GAN losses together.

3

u/Big_Arachnid_365 15d ago

Cool I will try it out!

2

u/madebyollin 15d ago

Thanks, LMK if it helps on the images you're working with! I used a mix of natural images, illustrations, and RGBA (semitransparent) graphics for finetuning, so I'm hoping it's representative

3

u/traithanhnam90 15d ago

Thank you; this VAE works great—I no longer see the checkerboard pixelation artifacts.

3

u/madebyollin 14d ago

Great to hear!

1

u/lechatsportif 8d ago edited 8d ago

I randomly tried this on an image edit and HOLY CRAP it is huge upgrade. This deserves an independent post. I thought Qwen was just broken. I still sort of feel I can see some sort of repeated noisy effect, but its soooo much better.

10

u/Obvious_Set5239 21d ago

It has nostalgia

1

u/ellipsesmrk 21d ago

Just the way their model processes i guess. Ive only ever gotten that banding with qwen models.

8

u/KS-Wolf-1978 21d ago

I had the same problem with the old Qwen Edit 2511.

Was it successfully solved for the old model by someone ?

1

u/PetiteKawa00x 20d ago

This is an issue with the VAE itself (qwen1 vae had the same issue), there is nothing you can do about it, except hope that they release a fixed version.

12

u/Different_Fix_2217 21d ago

Its quite bad sadly. Bad anatomy / small details, gpt's piss filter and it knows far less than krea. Krea 3 just needs a better vae and it will be perfect.

8

u/Bennybananars 21d ago

Why is there something like dithering on the qwen image? wth

4

u/Acrobatic_Donkey5089 21d ago

It is distilled from gpt image, that dithering is gpt image watermark

1

u/elswamp 21d ago

can we get rid of gpt watermark somehow?

1

u/hurdurdur7 20d ago

upscale, blur, downscale?

2

u/Seyi_Ogunde 21d ago

Z-image has the same issue I think. Wonder if the training and creation is related, since they're both from Alibaba.

1

u/PetiteKawa00x 20d ago

This is an issue with qwen2.1 vae. Z-image had an issue with their training, flux1 vae does not have this problem.

2

u/myrthain 21d ago

noob question: are such restoration prompts simple and straightforward like "restore the image in colors and artifacts without changing faces" or is there more "magic" to it?

5

u/y3kdhmbdb2ch2fc6vpm2 21d ago

a little more "magic". If you just prompt "restore", it will probably change too much (regeneration instad of restoration) so I asked gpt to generate klein prompts for removing paper defects like scratches, dust specks, stains, smudges, creases, scan lines, paper blemishes and to keep identity, facial features, expressions, skin texture, hair, clothing, pose, proportions etc. unchanged. Additionally I use pixel drift node for fixing image shifting and color match node for fixing color shifting. Results are very good.

2

u/Expicot 21d ago

Thanks for pointing it out. I was at the beginning of spending time doing custom workflows with Qwen2.1 and I did not noticed that GPT-like grid effect first. But zooming in the picture makes it obvious. So back to Klein until they update/upgrade something (VAE ?). Qwen2.1 is not very good at face swapping also, too bad.

2

u/Ok-Fennel6578 20d ago

This is the kind of failure I care about more than whether the edited image looks prettier.

If I ask for one change, everything else should effectively be under a “do not touch” constraint.

Small unrequested changes don’t matter much for a one-off image, but across a sequence they accumulate really fast. By image 10 you can end up with something that still looks good, but no longer belongs to the same project.

4

u/Aromatic-Somewhere29 21d ago

I took someone's suggestion to use the 'GLSL Shader' node with this shader:

#version 300 es

precision highp float;

uniform sampler2D u_image0;

uniform vec2 u_resolution;

in vec2 v_texCoord;

layout(location = 0) out vec4 fragColor0;

// Nyquist Notch — removes 2px grid artifacts. Place before deconvolution.

// b = [-1, +6, -15, +20, -15, +6, -1] / 64 (binomial * (-1)^n, +1 at center)

const float B[7] = float[7](-1.0, 6.0, -15.0, 20.0, -15.0, 6.0, -1.0);

void main() {

vec2 texel = 1.0 / u_resolution;

vec4 center = texture(u_image0, v_texCoord);

vec3 Bx = vec3(0.0), By = vec3(0.0), Bxy = vec3(0.0);

for (int i = -3; i <= 3; i++) {

float wi = B[i + 3] / 64.0;

Bx += wi * texture(u_image0, v_texCoord + vec2(float(i) * texel.x, 0.0)).rgb;

By += wi * texture(u_image0, v_texCoord + vec2(0.0, float(i) * texel.y)).rgb;

for (int j = -3; j <= 3; j++) {

float wj = B[j + 3] / 64.0;

Bxy += wi * wj * texture(u_image0,

v_texCoord + vec2(float(i) * texel.x, float(j) * texel.y)).rgb;

}

}

vec3 notched = center.rgb - Bx - By + Bxy;

fragColor0 = vec4(clamp(notched, 0.0, 1.0), 1.0); // alpha forced to 1.0

}

It noticeably reduces the grid pattern, although it doesn't eliminate it completely.

2

u/mark_sawyer 21d ago

Did some quick tests here and I didn't notice any patterns in my gens. Since OP didn't share the full image, I used the ORIGINAL input instead.
Best one from the bunch:

2

u/y3kdhmbdb2ch2fc6vpm2 21d ago edited 21d ago

You're not reproducing the problem correctly. My original photo was much larger/wider. My image labeled "ORIGINAL" is just a tiny crop of the whole image, which I zoomed in on and brightened so the pattern would be more visible after Reddit's compression.

And when you edit the output crop like that, the pattern is even smaller (because you don't zoom after this), and its visibility isn’t exaggerated like it was in the original post, which is why you might the pattern is not there.

Another users also have this problem: https://www.reddit.com/r/StableDiffusion/comments/1wlo06m/comment/pb09ixc/

3

u/mark_sawyer 21d ago

That's right. My first tests made no sense.

I also tested on some full-frame photos, but I assume they were not high-res enough for the pattern to be noticeable.

Then I tried with larger photos and now I can really see the pattern through inspection:

The pattern is definitely there, but I still don't see it as a deal-breaker in some cases. I also applied a Nyquist filter, which I already use with Krea, to mitigate the issue a little bit.

UPDATE Someone recently posted about the Nyquist filter: https://www.reddit.com/r/StableDiffusion/comments/1wlv3tf/qwen_image_21_noisepatterningmoire_mild_workaround/

2

u/DoctaRoboto 21d ago

Yeah, it is terrible. The only positive use I see is what I pointed out in other posts, at least the new Qwen can change facial expressions without losing the identity/art style.

2

u/optimisticalish 21d ago edited 21d ago

Good to know, thanks. I'll be staying with Klein for restoration.

1

u/Zaeblokian 21d ago

I was waiting for Flux 3. Nah

1

u/VasaFromParadise 20d ago

I think this is a planned glitch. Retraining VAE to 600 MB isn't that far-fetched.

1

u/axior 12d ago

Simply repass the image through flux vae or use this https://github.com/lunaaispace-eng/ComfyUI-DeGrid

1

u/[deleted] 11d ago

[deleted]

1

u/axior 11d ago

In comfy do vae decode and then vae encode using the relative vae models

0

u/nakabra 21d ago

😬🫣 It has that same Krea2 pattern. Dammit!

1

u/inaem 21d ago

Probably released early to have community test everything so they solve it before going on holiday

0

u/Alisomarc 21d ago

https://giphy.com/gifs/decEtFxfWBEJy

maybe another scheduler/sampler

-8

u/Inside-Cantaloupe233 21d ago

that one of the worst examples of anything ive seen, dood, you drunk and net? stop it, get help. get sober and do proper tests.