omerbt / MultiDiffusion

Official Pytorch Implementation for "MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generation" presenting "MultiDiffusion" (ICML 2023)
https://multidiffusion.github.io/
997 stars 59 forks source link

updates to region_based example #30

Open dribnet opened 2 months ago

dribnet commented 2 months ago

Changes to get region_based.py running examples from paper. Includes three sample masks. (those should should show up below) Fixes #28

Examples:

python region_based.py --W 512 --H 512 \
    --fg_masks "examples/elephant_mask.png" \
    --fg_prompts "A White Elephant" \
    --bg_prompt "Many stars and the milky way shining brighly in the dark night sky" \
    --outfile outputs/reboot_elepant_05.jpg

reboot_elepant_05

python region_based.py \
    --fg_masks "examples/pile_mask.png" "examples/pile_top_mask.png" \
    --fg_prompts "a tree trunk" "a bright red cardninal bird" \
    --bg_prompt "a desolate and arid desert" \
    --outfile outputs/reboot_bird_pile_05.jpg

reboot_bird_pile_05

Note that I renamed masks to be fg_masks to make it clear that those are foreground masks and each needs a corresponding fg_prompt (and optionally fg_negative, though those are now set by default to an empty string).