diff --git a/README.md b/README.md index 0ad0387..09d932d 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,18 @@ imagine --control-image pearl-girl.jpg --control-mode edit --init-image-strengt
+**Add Details Control (upscaling/super-resolution)** + +Replaces existing details in an image. Good to use with --init-image-strength 0.2 +```bash +imagine --control-image "assets/wishbone.jpg" --control-mode tile "sharp focus, high-resolution" --init-image-strength 0.2 --steps 30 -w 2048 -h 2048 +``` + ++ + +
+ ### Instruction based image edits [by InstructPix2Pix](https://github.com/timothybrooks/instruct-pix2pix) Just tell imaginairy how to edit the image and it will do it for you! @@ -424,6 +436,7 @@ docker run -it --gpus all -v $HOME/.cache/huggingface:/root/.cache/huggingface - ## ChangeLog +- 🎉 feature: add "detail" control mode. Add details to an image. Great for upscaling an image. - 🎉 feature: add "edit" control mode. Edit images using text instructions with any SD 1.5 based model. Similar to instructPix2Pix. - 🎉 feature: add "shuffle" control mode. Image is generated from elements of control image. Similar to style transfer. - 🎉 feature: upgrade to [controlnet 1.1](https://github.com/lllyasviel/ControlNet-v1-1-nightly) diff --git a/assets/wishbone.jpg b/assets/wishbone.jpg new file mode 100644 index 0000000..a379cd1 Binary files /dev/null and b/assets/wishbone.jpg differ diff --git a/assets/wishbone_big.jpg b/assets/wishbone_big.jpg new file mode 100644 index 0000000..0b5f21b Binary files /dev/null and b/assets/wishbone_big.jpg differ diff --git a/imaginairy/cli/imagine.py b/imaginairy/cli/imagine.py index 718311e..2a901c5 100644 --- a/imaginairy/cli/imagine.py +++ b/imaginairy/cli/imagine.py @@ -41,7 +41,18 @@ from imaginairy.cli.shared import ( default=None, show_default=False, type=click.Choice( - ["", "canny", "depth", "normal", "hed", "openpose", "shuffle", "edit"] + [ + "", + "canny", + "depth", + "normal", + "hed", + "openpose", + "shuffle", + "edit", + "inpaint", + "tile", + ] ), help="how the control image is used as signal", ) diff --git a/imaginairy/config.py b/imaginairy/config.py index 9faa375..9f85b67 100644 --- a/imaginairy/config.py +++ b/imaginairy/config.py @@ -220,6 +220,13 @@ CONTROLNET_CONFIGS = [ weights_url="https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/69fc48b9cbd98661f6d0288dc59b59a5ccb32a6b/control_v11p_sd15_inpaint.pth", alias="inpaint", ), + ControlNetConfig( + short_name="details15", + control_type="details", + config_path="configs/control-net-v15.yaml", + weights_url="https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/69fc48b9cbd98661f6d0288dc59b59a5ccb32a6b/control_v11f1e_sd15_tile.pth", + alias="details", + ), ] CONTROLNET_CONFIG_SHORTCUTS = {m.short_name: m for m in CONTROLNET_CONFIGS} diff --git a/imaginairy/img_processors/control_modes.py b/imaginairy/img_processors/control_modes.py index b5beecd..1bd4251 100644 --- a/imaginairy/img_processors/control_modes.py +++ b/imaginairy/img_processors/control_modes.py @@ -199,4 +199,5 @@ CONTROL_MODES = { "shuffle": shuffle_map_torch, "edit": noop, "inpaint": noop, + "details": noop, } diff --git a/tests/expected_output/test_control_images[details-noop]_.png b/tests/expected_output/test_control_images[details-noop]_.png new file mode 100644 index 0000000..ba6c1e1 Binary files /dev/null and b/tests/expected_output/test_control_images[details-noop]_.png differ diff --git a/tests/expected_output/test_control_images[edit-noop]_.png b/tests/expected_output/test_control_images[edit-noop]_.png new file mode 100644 index 0000000..ba6c1e1 Binary files /dev/null and b/tests/expected_output/test_control_images[edit-noop]_.png differ diff --git a/tests/expected_output/test_control_images[inpaint-noop]_.png b/tests/expected_output/test_control_images[inpaint-noop]_.png new file mode 100644 index 0000000..ba6c1e1 Binary files /dev/null and b/tests/expected_output/test_control_images[inpaint-noop]_.png differ