mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-08 05:12:35 +00:00
Removed changes in some scripts since the arguments for soft painting are no longer passed through the same path as "mask_blur".
This commit is contained in:
@@ -10,7 +10,6 @@ from PIL import Image, ImageDraw
|
||||
from modules import images
|
||||
from modules.processing import Processed, process_images
|
||||
from modules.shared import opts, state
|
||||
import modules.soft_inpainting as si
|
||||
|
||||
|
||||
# this function is taken from https://github.com/parlance-zz/g-diffuser-bot
|
||||
@@ -134,14 +133,13 @@ class Script(scripts.Script):
|
||||
|
||||
pixels = gr.Slider(label="Pixels to expand", minimum=8, maximum=256, step=8, value=128, elem_id=self.elem_id("pixels"))
|
||||
mask_blur = gr.Slider(label='Mask blur', minimum=0, maximum=64, step=1, value=8, elem_id=self.elem_id("mask_blur"))
|
||||
soft_inpainting = si.gradio_ui()[0]
|
||||
direction = gr.CheckboxGroup(label="Outpainting direction", choices=['left', 'right', 'up', 'down'], value=['left', 'right', 'up', 'down'], elem_id=self.elem_id("direction"))
|
||||
noise_q = gr.Slider(label="Fall-off exponent (lower=higher detail)", minimum=0.0, maximum=4.0, step=0.01, value=1.0, elem_id=self.elem_id("noise_q"))
|
||||
color_variation = gr.Slider(label="Color variation", minimum=0.0, maximum=1.0, step=0.01, value=0.05, elem_id=self.elem_id("color_variation"))
|
||||
|
||||
return [info, pixels, mask_blur, *soft_inpainting, direction, noise_q, color_variation]
|
||||
return [info, pixels, mask_blur, direction, noise_q, color_variation]
|
||||
|
||||
def run(self, p, _, pixels, mask_blur, mask_blend_enabled, mask_blend_power, mask_blend_scale, inpaint_detail_preservation, direction, noise_q, color_variation):
|
||||
def run(self, p, _, pixels, mask_blur, direction, noise_q, color_variation):
|
||||
initial_seed_and_info = [None, None]
|
||||
|
||||
process_width = p.width
|
||||
@@ -170,9 +168,6 @@ class Script(scripts.Script):
|
||||
p.mask_blur_x = mask_blur_x*4
|
||||
p.mask_blur_y = mask_blur_y*4
|
||||
|
||||
p.soft_inpainting = si.SoftInpaintingSettings(mask_blend_power, mask_blend_scale, inpaint_detail_preservation) \
|
||||
if mask_blend_enabled else None
|
||||
|
||||
init_img = p.init_images[0]
|
||||
target_w = math.ceil((init_img.width + left + right) / 64) * 64
|
||||
target_h = math.ceil((init_img.height + up + down) / 64) * 64
|
||||
|
@@ -7,7 +7,6 @@ from PIL import Image, ImageDraw
|
||||
from modules import images, devices
|
||||
from modules.processing import Processed, process_images
|
||||
from modules.shared import opts, state
|
||||
import modules.soft_inpainting as si
|
||||
|
||||
|
||||
class Script(scripts.Script):
|
||||
@@ -23,19 +22,16 @@ class Script(scripts.Script):
|
||||
|
||||
pixels = gr.Slider(label="Pixels to expand", minimum=8, maximum=256, step=8, value=128, elem_id=self.elem_id("pixels"))
|
||||
mask_blur = gr.Slider(label='Mask blur', minimum=0, maximum=64, step=1, value=4, elem_id=self.elem_id("mask_blur"))
|
||||
soft_inpainting = si.gradio_ui()[0]
|
||||
inpainting_fill = gr.Radio(label='Masked content', choices=['fill', 'original', 'latent noise', 'latent nothing'], value='fill', type="index", elem_id=self.elem_id("inpainting_fill"))
|
||||
direction = gr.CheckboxGroup(label="Outpainting direction", choices=['left', 'right', 'up', 'down'], value=['left', 'right', 'up', 'down'], elem_id=self.elem_id("direction"))
|
||||
|
||||
return [pixels, mask_blur, *soft_inpainting, inpainting_fill, direction]
|
||||
return [pixels, mask_blur, inpainting_fill, direction]
|
||||
|
||||
def run(self, p, pixels, mask_blur, mask_blend_enabled, mask_blend_power, mask_blend_scale, inpaint_detail_preservation, inpainting_fill, direction):
|
||||
def run(self, p, pixels, mask_blur, inpainting_fill, direction):
|
||||
initial_seed = None
|
||||
initial_info = None
|
||||
|
||||
p.mask_blur = mask_blur * 2
|
||||
p.soft_inpainting = si.SoftInpaintingSettings(mask_blend_power, mask_blend_scale, inpaint_detail_preservation) \
|
||||
if mask_blend_enabled else None
|
||||
p.inpainting_fill = inpainting_fill
|
||||
p.inpaint_full_res = False
|
||||
|
||||
|
Reference in New Issue
Block a user