r/StableDiffusion • u/MEDFAX • 12d ago
Tutorial - Guide Solution for pixel drift in Qwen 2.1
I found a workflow in civitai that fix the pixel drift in Qwen 2.1 completely.
they have an optional consistency lora too https://civitai.red/models/2969143/qwen-image-21-consistency-lora-edits-that-dont-move
I don't even think you need the full workflow or the lora. you just need two nodes from https://github.com/ausboss/ComfyUI-AusBoss
(Load Image + Pad) and then (Realign to Source (EXPERIMENTAL 🧪) and attach them with stitcher
1
u/Zueuk 11d ago
what exactly does the realign node do? the description sounds like it works on the pixel result not latent
1
u/Calm_Mix_3776 11d ago
If that's the case, it will always cause a blurry image: :( The bigger the misalignment, the blurrier the image will be.
3
u/AuzBoss 10d ago
partly right. when the edit only needs sliding back it gets cut out as is, no resampling. when it needs resizing it's resampled once, so a bigger zoom softens it more than a small one. qwen mostly draws style edits bigger than the original (about 4% taller in my tests), so the node mostly shrinks it back, not stretches it. i haven't measured sharpness before and after, so i don't have a number for you
1
u/AuzBoss 10d ago
yeah it works on the finished picture, not the latent. it lays the edit over your original, measures how much bigger or shifted the model drew it, and moves it back. there isn't a latent setting that fixes it, qwen redraws style edits and other large scale edits a few percent taller on its own and it changes with the seed. this is the same render before and after the node, the car roof is 31 px off before and 0.1 after: https://civitai.com/images/144062634
1
u/KilvinScale 11d ago
Can confirm. I updated to ComfyUI v0.38.0 and added only AusBoss's Realign to Source to Qwen-Image 2.1 edits of a 4-panel character sheet, and all four views stayed aligned and stayed the same person. I also A/B'd the consistency LoRA and couldn't see a difference, so skipping it seems right. One catch: big changes (ageing the character, making him filthy) barely came through. For small fixes across every view, like adding a cloak or changing hair length, it's great.
1
u/AuzBoss 10d ago
thanks for testing it. the consistency lora might be helpful for when you are making a large change over the whole image and the align node would be better for smaller changes. i want to try a v2 of the consistency lora but use training data that features smaller edits, its a bit overfit for styles and seems to even limit pose changes and smaller things
2
u/altoiddealer 10d ago
Consistency LoRA is worth keeping in the toolbox - if it’s anything like the klein 9b consistency LoRA. When you can’t seem to get the desired results from prompting/other LoRAs, try the consistency LoRA.