Q2.1 ~Fix Contour~ LoRA (Transparency)
Shout-Out
First of all - shout out to shootthesound (creator of FizGig), who made this LoRA possible by implementing proper transparency handling when creating LoRA's for Qwen 2.1. Woohoo!
Why
Q2.1 can be quite great when handling transparency... and it can utterly fail. When editing an image with a good contour / transparent background it tends to introduce jagged edges and aliasing even at higher resolutions.
This LoRA is my first attempt to fix this issue.
How to use
LoRA strength: 1.0 works fine. Less works less than intended. Going over 1.0 introduces additional artifacts.
Prompt: "Fix the subject’s contour in areas that need fixing. Preserve well defined areas."
(I tested variations and "Fix the subject’s contour." was the training caption and might suffice, but the extra tokens don't hurt either)
Background removal
The LoRA should also help with background removal, though that was not the purpose of the LoRA. Trained on the caption: "Remove the background."
(as you can see in the image with the same Seed, Q2.1 already does a great job, but with Fix-Contour it stays closer to the original; Gradient was added to better see the differences)
Training
Trained with 32 images. A mix of photos, drawings & 3D renders x2. 1 set with black/white/grey backgrounds & 1 set with bad/jagged contours. Fizgig, Rank32, Automagic v3 (starting at 2e-4), 1.05mp, Ema 0.98, no caption dropout.
Samples
All images were edited with the same Seed and parameters. The only difference was the LoRA.
p.s.:
I do realize Qwen 2.1 did rather well on it's own. Funnily enough it did a worse job during my experiments before I created the dataset and trained my LoRA. The devil is in the details. If you are a stickler for fine detail like me, "Fix Contour" can be an asset for your workflows.
p.p.s.:
It's not perfect, mind you... but until somebody can help me figure out how to fix Q2.1's tendency to make the contour brighter, this is where it's at. The LoRA trained rather fast and well. I don't think just throwing more epochs at it will help much. Automagic v3 was already down to ~2.5e-5.
p.p.p.s.:
"Contour" doesn't sound cool... but it's the most precise term for the edge of a subject with transparency.
Description
Epoch 10 of the initial training with Fizgig's RGBA updates.





