zperzendetta / sd-webui-mosaic-outpaint

An Extension for Automatic1111 Webui that trivializes outpainting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SD Webui Mosaic Outpaint

This is an Extension for the Automatic1111 Webui, which trivializes outpainting via a mosaic pattern, without the need of ControlNet!

Inspired by this Reddit Post by u/wonderflex


New Mosaic UI Tab

How to Use

  1. Inside the Mosaic tab, upload an image of choice
  2. Choose the direction(s) to outpaint
  3. Adjust the parameters (explained below) as needed
  4. Press Process Mosaic
  5. Once the images have been processed, press Send to Inpaint
  6. In img2img tab, fill out the captions of the image
    • eg. The prompt used during txt2img
  7. Set Inpaint area to Whole picture to keep the coherency; Increase Mask blur as needed
  8. Set the Denoising strength to 0.9 ~ 1.0
  9. Set the resolution to Resize by 1.0
  10. Press Generate !

ControlNet

  1. Alternatively: choose either txt2img or img2img tab, set the unit of ControlNet, then press Send to ControlNet
    • Due to ControlNet's custom editor, the source image may not show up. Simply click the Clear button (eraser icon) to refresh it.
  2. Set Control Type to Inpaint
  3. Set Preprocessor to inpaint_only+lama
  4. Set Control Mode to ControlNet is more important
  5. Set the resolution accordingly
  6. Press Generate !

Parameters

  • Directions: The side of the image to expand
    • Selecting multiple sides is available
  • Method: The method used to fill out the expanded space
    • stretch: Strecth the border of the image outwards (used in the original post)
      • Stretch %: The percentage of the expanded area used to stretch
      • Stretch Ratio: The scale of the stretching
    • mirror: Only mirror the image
  • Horitontal Expand %: How much to expand in horitonzal direction
  • Vertical Expand %: How much to expand in vertical direction
  • Short-Side Tile Count: The number of horizontal tiles when expanding horitonzally (vice versa for vertical)
  • Long-Side Tile Count: The number of vertical tiles when expanding horitonzally (vice versa for vertical)
  • Mask Overlap %: The percentage of the original image to include in the Inpaint mask
    • Higher value reduces the seams, but also alters the original image

Example


Input Image


Mosaic Pattern


Final Output

Mosaic Inpaint

Now also comes with a Script for generating mosaic patterns within Inpaint masks. (Can also be used in img2img to convert the entire image into mosaic patterns before the generation.)

See this thread for some examples


Note: If you have installed this extension before (in the Extensions tab, it shows the Branch of this extension to be main), please uninstall and reinstall again (so that it shows master instead)!

About

An Extension for Automatic1111 Webui that trivializes outpainting

License:MIT License


Languages

Language:Python 81.6%Language:JavaScript 18.4%