diff --git a/README.md b/README.md index 652d483..f65038c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Adds various useful tools for pixel art to the Extras tab. ### Purpose -This extension is used to fix non symmetrical pixels in ai pixel art through downscaling. +This extension is used to fix asymmetrical pixels in AI-generated pixel art through downscaling. It also can be used to limit color palette and clamp grayscale values to get more stylized results. You can also use the rescale feature to get a higher resolution image (best for preview on the webui canvas). For use with this [webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) @@ -21,6 +21,5 @@ Extensions > Install from URL > Paste `https://github.com/Leodotpy/sd-pixel` > I | Gray Limit | ![](examples/before-gray.png) | ![bad apple](examples/after-gray.png) | - # Credits * Thanks AUTOMATIC1111 for an awesome sd webui diff --git a/install.py b/install.py index f32910c..f54bd55 100644 --- a/install.py +++ b/install.py @@ -1,5 +1,6 @@ import launch +# This extension uses cv2 for image effects if not launch.is_installed("opencv-python"): launch.run_pip("install opencv-python", "opencv-python") diff --git a/scripts/postprocessing_pixel.py b/scripts/postprocessing_pixel.py index 565cd39..240009e 100644 --- a/scripts/postprocessing_pixel.py +++ b/scripts/postprocessing_pixel.py @@ -3,7 +3,6 @@ import numpy as np from PIL import Image from modules import scripts_postprocessing import gradio as gr - from modules.ui_components import FormRow, FormColumn, FormGroup, ToolButton, FormHTML @@ -69,7 +68,7 @@ class ScriptPostprocessingUpscale(scripts_postprocessing.ScriptPostprocessing): self.graylimit.enabled = value def ui(self): - with FormGroup() as form_group: + with FormGroup(): # Pixelate and rescale with FormRow(): pixelate_cb = gr.Checkbox(label="Pixelate", value=False, on_change=self.on_pixelate_change,