2022-09-15 14:53:41 +00:00
|
|
|
---
|
|
|
|
title: Image-to-Image
|
|
|
|
---
|
2022-09-11 15:52:43 +00:00
|
|
|
|
2022-09-18 19:30:18 +00:00
|
|
|
# :material-image-multiple: **IMG2IMG**
|
|
|
|
|
2022-09-15 14:53:41 +00:00
|
|
|
This script also provides an `img2img` feature that lets you seed your creations with an initial
|
|
|
|
drawing or photo. This is a really cool feature that tells stable diffusion to build the prompt on
|
|
|
|
top of the image you provide, preserving the original's basic shape and layout. To use it, provide
|
|
|
|
the `--init_img` option as shown here:
|
2022-09-11 15:52:43 +00:00
|
|
|
|
2022-09-15 14:53:41 +00:00
|
|
|
```bash
|
2022-09-11 15:52:43 +00:00
|
|
|
dream> "waterfall and rainbow" --init_img=./init-images/crude_drawing.png --strength=0.5 -s100 -n4
|
|
|
|
```
|
|
|
|
|
2022-09-15 14:53:41 +00:00
|
|
|
The `--init_img (-I)` option gives the path to the seed picture. `--strength (-f)` controls how much
|
|
|
|
the original will be modified, ranging from `0.0` (keep the original intact), to `1.0` (ignore the
|
|
|
|
original completely). The default is `0.75`, and ranges from `0.25-0.75` give interesting results.
|
2022-09-11 15:52:43 +00:00
|
|
|
|
2022-09-14 13:47:17 +00:00
|
|
|
You may also pass a `-v<variation_amount>` option to generate `-n<iterations>` count variants on
|
2022-09-11 18:26:41 +00:00
|
|
|
the original image. This is done by passing the first generated image
|
|
|
|
back into img2img the requested number of times. It generates
|
|
|
|
interesting variants.
|
2022-09-11 15:52:43 +00:00
|
|
|
|
2022-09-15 14:53:41 +00:00
|
|
|
If the initial image contains transparent regions, then Stable Diffusion will only draw within the
|
|
|
|
transparent regions, a process called "inpainting". However, for this to work correctly, the color
|
|
|
|
information underneath the transparent needs to be preserved, not erased.
|
|
|
|
|
|
|
|
More Details can be found here:
|
|
|
|
[Creating Transparent Images For Inpainting](./INPAINTING.md#creating-transparent-regions-for-inpainting)
|