feature: add "detail" control mode.

Add details to an image. Great for upscaling an image.
This commit is contained in:
Bryce 2023-05-05 02:40:40 -07:00 committed by Bryce Drennan
parent b5356b143f
commit db8d3b74ea
9 changed files with 33 additions and 1 deletions

View File

@ -117,6 +117,18 @@ imagine --control-image pearl-girl.jpg --control-mode edit --init-image-strengt
<img src="assets/pearl_beach_019561_862735879_kdpmpp2m30_PS7.0_img2img-0.01_make_it_at_the_beach.jpg" height="256"> <img src="assets/pearl_beach_019561_862735879_kdpmpp2m30_PS7.0_img2img-0.01_make_it_at_the_beach.jpg" height="256">
</p> </p>
**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
```
<p float="left">
<img src="assets/wishbone.jpg" height="512">
<img src="assets/wishbone_big.jpg" height="512">
</p>
### Instruction based image edits [by InstructPix2Pix](https://github.com/timothybrooks/instruct-pix2pix) ### 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! 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 ## 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 "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: 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) - 🎉 feature: upgrade to [controlnet 1.1](https://github.com/lllyasviel/ControlNet-v1-1-nightly)

BIN
assets/wishbone.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
assets/wishbone_big.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

View File

@ -41,7 +41,18 @@ from imaginairy.cli.shared import (
default=None, default=None,
show_default=False, show_default=False,
type=click.Choice( 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", help="how the control image is used as signal",
) )

View File

@ -220,6 +220,13 @@ CONTROLNET_CONFIGS = [
weights_url="https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/69fc48b9cbd98661f6d0288dc59b59a5ccb32a6b/control_v11p_sd15_inpaint.pth", weights_url="https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/69fc48b9cbd98661f6d0288dc59b59a5ccb32a6b/control_v11p_sd15_inpaint.pth",
alias="inpaint", 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} CONTROLNET_CONFIG_SHORTCUTS = {m.short_name: m for m in CONTROLNET_CONFIGS}

View File

@ -199,4 +199,5 @@ CONTROL_MODES = {
"shuffle": shuffle_map_torch, "shuffle": shuffle_map_torch,
"edit": noop, "edit": noop,
"inpaint": noop, "inpaint": noop,
"details": noop,
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 KiB