cloneofsimo / paint-with-words-sd

Implementation of Paint-with-words with Stable Diffusion : method from eDiff-I that let you generate image from text-labeled segmentation map.
MIT License
635 stars 52 forks source link

Cannot reproduce results #9

Closed helia95 closed 1 year ago

helia95 commented 1 year ago

Hi, when running runner.py I obtain different results from the ones showed in readme file

aurora_0 5-full moon_1 5-mountains_0 4-a half-frozen lake_0 3-boat_2 0

this is what I got using EXAMPLE_SETTING_3. I tried increasing the strength of "full moon" and "boat", I'm able to obtain the moon but the boat never showed up.

Any guess?

cloneofsimo commented 1 year ago

Try the code with this

img = paint_with_words(
        color_context=color_context,
        color_map_image=color_map_image,
        input_prompt=input_prompt,
        num_inference_steps=30,
        guidance_scale=7.5,
        device="cuda:0",
        weight_function=lambda w, sigma, qk: 0.4 * w * math.log(1 + sigma) * qk.max(),
    )

I made update to have default weight function to 0.1 w math.log(1 + sigma) * qk.max(), and readme was made before that.

cloneofsimo commented 1 year ago

Should get : image

helia95 commented 1 year ago

Thanks, it works now!