From 929eff353e77bba63c6bdde891080dc18e70a82c Mon Sep 17 00:00:00 2001 From: Bryce Date: Fri, 17 Feb 2023 13:36:53 -0800 Subject: [PATCH] fix: edit was broken by recent changes --- README.md | 2 +- imaginairy/api.py | 2 +- imaginairy/cmds.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1de2ee2..ff1b7cb 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ with prompt-based masking. # enter imaginairy shell >> aimg 🤖🧠> 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 bowl_of_fruit.jpg -p "replace the fruit with strawberries" 🤖🧠> edit freckled_woman.jpg -p "make her a cyborg" --prompt-strength 13 diff --git a/imaginairy/api.py b/imaginairy/api.py index 98baf9f..d11d552 100755 --- a/imaginairy/api.py +++ b/imaginairy/api.py @@ -408,7 +408,7 @@ def _generate_single_image( elif model.cond_stage_key == "edit": # 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)] denoiser_cls = CFGEditingDenoiser if c_cat: diff --git a/imaginairy/cmds.py b/imaginairy/cmds.py index fe44fb3..51fd88c 100644 --- a/imaginairy/cmds.py +++ b/imaginairy/cmds.py @@ -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 can batch edit images. """ + allow_compose_phase = False return _imagine_cmd( ctx, prompt, @@ -557,6 +558,7 @@ def edit_image( # noqa tile, tile_x, tile_y, + allow_compose_phase, mask_image, mask_prompt, mask_mode,