mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-04-30 19:21:33 +00:00
fix: misc
This commit is contained in:
@@ -41,14 +41,14 @@ class ADetailerArgs(BaseModel, extra=Extra.forbid):
|
|||||||
ad_confidence: confloat(ge=0.0, le=1.0) = 0.3
|
ad_confidence: confloat(ge=0.0, le=1.0) = 0.3
|
||||||
ad_mask_min_ratio: confloat(ge=0.0, le=1.0) = 0.0
|
ad_mask_min_ratio: confloat(ge=0.0, le=1.0) = 0.0
|
||||||
ad_mask_max_ratio: confloat(ge=0.0, le=1.0) = 1.0
|
ad_mask_max_ratio: confloat(ge=0.0, le=1.0) = 1.0
|
||||||
ad_dilate_erode: int = 32
|
ad_dilate_erode: int = 4
|
||||||
ad_x_offset: int = 0
|
ad_x_offset: int = 0
|
||||||
ad_y_offset: int = 0
|
ad_y_offset: int = 0
|
||||||
ad_mask_merge_invert: Literal["None", "Merge", "Merge and Invert"] = "None"
|
ad_mask_merge_invert: Literal["None", "Merge", "Merge and Invert"] = "None"
|
||||||
ad_mask_blur: NonNegativeInt = 4
|
ad_mask_blur: NonNegativeInt = 4
|
||||||
ad_denoising_strength: confloat(ge=0.0, le=1.0) = 0.4
|
ad_denoising_strength: confloat(ge=0.0, le=1.0) = 0.4
|
||||||
ad_inpaint_only_masked: bool = True
|
ad_inpaint_only_masked: bool = True
|
||||||
ad_inpaint_only_masked_padding: NonNegativeInt = 0
|
ad_inpaint_only_masked_padding: NonNegativeInt = 32
|
||||||
ad_use_inpaint_width_height: bool = False
|
ad_use_inpaint_width_height: bool = False
|
||||||
ad_inpaint_width: PositiveInt = 512
|
ad_inpaint_width: PositiveInt = 512
|
||||||
ad_inpaint_height: PositiveInt = 512
|
ad_inpaint_height: PositiveInt = 512
|
||||||
@@ -79,7 +79,7 @@ class ADetailerArgs(BaseModel, extra=Extra.forbid):
|
|||||||
key: str,
|
key: str,
|
||||||
pops: list[str] | None = None,
|
pops: list[str] | None = None,
|
||||||
cond: Any = None,
|
cond: Any = None,
|
||||||
):
|
) -> None:
|
||||||
if pops is None:
|
if pops is None:
|
||||||
pops = [key]
|
pops = [key]
|
||||||
if key not in p:
|
if key not in p:
|
||||||
@@ -91,7 +91,7 @@ class ADetailerArgs(BaseModel, extra=Extra.forbid):
|
|||||||
for k in pops:
|
for k in pops:
|
||||||
p.pop(k, None)
|
p.pop(k, None)
|
||||||
|
|
||||||
def extra_params(self, suffix: str = ""):
|
def extra_params(self, suffix: str = "") -> dict[str, Any]:
|
||||||
if self.ad_model == "None":
|
if self.ad_model == "None":
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|||||||
@@ -174,9 +174,7 @@ def one_ui_group(
|
|||||||
for attr in ALL_ARGS.attrs:
|
for attr in ALL_ARGS.attrs:
|
||||||
widget = getattr(w, attr)
|
widget = getattr(w, attr)
|
||||||
on_change = partial(on_widget_change, attr=attr)
|
on_change = partial(on_widget_change, attr=attr)
|
||||||
widget.change(
|
widget.change(fn=on_change, inputs=[state, widget], outputs=state, queue=False)
|
||||||
fn=on_change, inputs=[state, widget], outputs=[state], queue=False
|
|
||||||
)
|
|
||||||
|
|
||||||
all_inputs = [state, *w.tolist()]
|
all_inputs = [state, *w.tolist()]
|
||||||
target_button = i2i_button if is_img2img else t2i_button
|
target_button = i2i_button if is_img2img else t2i_button
|
||||||
|
|||||||
Reference in New Issue
Block a user