/sd-web-ui-scripts

Custom scripts for the stable diffusion web ui by AUTOMATIC1111

Primary LanguagePython

sd-web-ui-scripts

Custom scripts for the stable diffusion web ui by AUTOMATIC1111

Mosaicing

example

The algorithm in action:

https://www.youtube.com/watch?v=t7nopq27uaM

UI:

UI

Installation

Download mosaic.py and place it in the stable-diffusion-webui/scripts folder, then restart webui.

Usage

You can find the algorithm in the img2img tab under "Scripts".

  • Patches will be resized for processing from patch size to whatever your width and height settings are and then scaled back down for the mosaic.
  • elliptical mask shape will lead to less visible seems/patches, but requires a larger overlap in order to not produce gaps
  • more overlap means more patches to process and thus longer computation
  • Use preview mode to view how a single patch would look after processing, before committing the entire image.
  • Use mask preview mode to check the coverage of the mask pattern for your image (white means a pixel will be regenerated, black parts of the image will remain untouched). You can combine this with the preview mode in order to examine a single mask.
  • "Upscale amount" will upscale the image using bilinear upscaling before processing. For better results, I'd recommend manual upscaling with a better upscaler.

Results / Examples / Experimentation

https://imgur.com/a/y0A6qO1

Original reddit thread

https://www.reddit.com/r/StableDiffusion/comments/xa48o6/enhancing_local_detail_and_cohesion_by_mosaicing/