mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-07-21 21:01:24 +08:00
detect
This commit is contained in:
parent
efb653517a
commit
e753e36c8d
@ -2,6 +2,8 @@ import gradio as gr
|
||||
from lib_multidiffusion.tiled_diffusion import TiledDiffusion
|
||||
|
||||
from modules import scripts
|
||||
from modules.ui import detect_image_size_symbol
|
||||
from modules.ui_common import ToolButton
|
||||
from modules.ui_components import InputAccordion
|
||||
|
||||
|
||||
@ -19,11 +21,20 @@ class MultiDiffusionForForge(scripts.Script):
|
||||
method = gr.Radio(label="Method", choices=("MultiDiffusion", "Mixture of Diffusers"), value="Mixture of Diffusers")
|
||||
with gr.Row():
|
||||
tile_width = gr.Slider(label="Tile Width", minimum=256, maximum=2048, step=64, value=768)
|
||||
detect_size = ToolButton(value=detect_image_size_symbol, elem_id=self.elem_id("detect_size"), tooltip="Auto detect size from image")
|
||||
tile_height = gr.Slider(label="Tile Height", minimum=256, maximum=2048, step=64, value=768)
|
||||
with gr.Row():
|
||||
tile_overlap = gr.Slider(label="Tile Overlap", minimum=0, maximum=1024, step=16, value=64)
|
||||
tile_batch_size = gr.Slider(label="Tile Batch Size", minimum=1, maximum=8, step=1, value=1)
|
||||
|
||||
detect_size.click(
|
||||
fn=lambda w, h: (w or gr.skip(), h or gr.skip()),
|
||||
_js="currentImg2imgSourceResolution",
|
||||
inputs=[tile_width, tile_height],
|
||||
outputs=[tile_width, tile_height],
|
||||
show_progress=False,
|
||||
)
|
||||
|
||||
return enabled, method, tile_width, tile_height, tile_overlap, tile_batch_size
|
||||
|
||||
def process_before_every_sampling(self, p, enabled: bool, method: str, tile_width: int, tile_height: int, tile_overlap: int, tile_batch_size: int, **kwargs):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user