fix: edit was broken by recent changes

This commit is contained in:
Bryce 2023-02-17 13:36:53 -08:00 committed by Bryce Drennan
parent 5b1cded94f
commit 929eff353e
3 changed files with 4 additions and 2 deletions

View File

@ -56,7 +56,7 @@ with prompt-based masking.
# enter imaginairy shell # enter imaginairy shell
>> aimg >> aimg
🤖🧠> edit scenic_landscape.jpg -p "make it winter" --prompt-strength 20 🤖🧠> edit scenic_landscape.jpg -p "make it winter" --prompt-strength 20
🤖🧠> edit scenic_landscape.jpg -p "make it winter" --steps 30 --arg-schedule "prompt_strength[2:25:0.5]" --compilation-anim 🤖🧠> edit scenic_landscape.jpg -p "make it winter" --steps 30 --arg-schedule "prompt_strength[2:25:0.5]" --compilation-anim gif
🤖🧠> edit dog.jpg -p "make the dog red" --prompt-strength 5 🤖🧠> edit dog.jpg -p "make the dog red" --prompt-strength 5
🤖🧠> edit bowl_of_fruit.jpg -p "replace the fruit with strawberries" 🤖🧠> edit bowl_of_fruit.jpg -p "replace the fruit with strawberries"
🤖🧠> edit freckled_woman.jpg -p "make her a cyborg" --prompt-strength 13 🤖🧠> edit freckled_woman.jpg -p "make her a cyborg" --prompt-strength 13

View File

@ -408,7 +408,7 @@ def _generate_single_image(
elif model.cond_stage_key == "edit": elif model.cond_stage_key == "edit":
# pix2pix model # pix2pix model
c_cat = [model.encode_first_stage(init_image_t).mode()] c_cat = [model.encode_first_stage(init_image_t)]
c_cat_neutral = [torch.zeros_like(init_latent)] c_cat_neutral = [torch.zeros_like(init_latent)]
denoiser_cls = CFGEditingDenoiser denoiser_cls = CFGEditingDenoiser
if c_cat: if c_cat:

View File

@ -533,6 +533,7 @@ def edit_image( # noqa
Same as calling `aimg imagine --model edit --init-image my-dog.jpg --init-image-strength 1` except this command Same as calling `aimg imagine --model edit --init-image my-dog.jpg --init-image-strength 1` except this command
can batch edit images. can batch edit images.
""" """
allow_compose_phase = False
return _imagine_cmd( return _imagine_cmd(
ctx, ctx,
prompt, prompt,
@ -557,6 +558,7 @@ def edit_image( # noqa
tile, tile,
tile_x, tile_x,
tile_y, tile_y,
allow_compose_phase,
mask_image, mask_image,
mask_prompt, mask_prompt,
mask_mode, mask_mode,