How to generate white background images instead of colorful? #14813
Unanswered
emadyounan
asked this question in
Q&A
Replies: 1 comment 1 reply
|
Your load_square() function does composite transparent inputs onto white, so BG_COLOR itself is not an inference-time background control. The result means the LoRA/text conditioning has not learned “white background” strongly enough to override SD 1.5’s background prior. I would debug it in this order:
A UNet attention LoRA is good at learning style/concepts but is not a pixel-level background guarantee. If production output must be exactly #FFFFFF, the reliable solution is segmentation/alpha extraction followed by compositing onto white (or an explicit conditioning/mask workflow). Use the LoRA for the asset style and enforce the final background deterministically in post-processing. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

















Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm trying to train stable-diffusion-v1-5/stable-diffusion-v1-5 with custom data with LoraConfig to generate a type of 2D asset.
So I have a dataset of transparent PNG images, and I added to my prompt text for every image a white background after the caption
And in my script, I added BG_COLOR = (255, 255, 255)
and that's my code
But I got this image
thanks and regards
All reactions