fix formatting

master
Leodotpy 2023-05-05 13:07:25 -04:00
parent 2fbbefd6d7
commit 7237a76d59
3 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,7 @@
Adds various useful tools for pixel art to the Extras tab. Adds various useful tools for pixel art to the Extras tab.
### Purpose ### 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). 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) 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) | | Gray Limit | ![](examples/before-gray.png) | ![bad apple](examples/after-gray.png) |
# Credits # Credits
* Thanks AUTOMATIC1111 for an awesome sd webui * Thanks AUTOMATIC1111 for an awesome sd webui

View File

@ -1,5 +1,6 @@
import launch import launch
# This extension uses cv2 for image effects
if not launch.is_installed("opencv-python"): if not launch.is_installed("opencv-python"):
launch.run_pip("install opencv-python", "opencv-python") launch.run_pip("install opencv-python", "opencv-python")

View File

@ -3,7 +3,6 @@ import numpy as np
from PIL import Image from PIL import Image
from modules import scripts_postprocessing from modules import scripts_postprocessing
import gradio as gr import gradio as gr
from modules.ui_components import FormRow, FormColumn, FormGroup, ToolButton, FormHTML from modules.ui_components import FormRow, FormColumn, FormGroup, ToolButton, FormHTML
@ -69,7 +68,7 @@ class ScriptPostprocessingUpscale(scripts_postprocessing.ScriptPostprocessing):
self.graylimit.enabled = value self.graylimit.enabled = value
def ui(self): def ui(self):
with FormGroup() as form_group: with FormGroup():
# Pixelate and rescale # Pixelate and rescale
with FormRow(): with FormRow():
pixelate_cb = gr.Checkbox(label="Pixelate", value=False, on_change=self.on_pixelate_change, pixelate_cb = gr.Checkbox(label="Pixelate", value=False, on_change=self.on_pixelate_change,