mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-01-26 11:19:53 +00:00
fix: add PL rule
This commit is contained in:
@@ -133,7 +133,7 @@ def get_table(title: str, data: dict[str, Any]) -> Table:
|
|||||||
table.add_column("Value")
|
table.add_column("Value")
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
if not isinstance(value, str):
|
if not isinstance(value, str):
|
||||||
value = repr(value)
|
value = repr(value) # noqa: PLW2901
|
||||||
table.add_row(key, value)
|
table.add_row(key, value)
|
||||||
|
|
||||||
return table
|
return table
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ def mask_preprocessing(w: Widgets, n: int, is_img2img: bool):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def inpainting(w: Widgets, n: int, is_img2img: bool, webui_info: WebuiInfo):
|
def inpainting(w: Widgets, n: int, is_img2img: bool, webui_info: WebuiInfo): # noqa: PLR0915
|
||||||
eid = partial(elem_id, n=n, is_img2img=is_img2img)
|
eid = partial(elem_id, n=n, is_img2img=is_img2img)
|
||||||
|
|
||||||
with gr.Group():
|
with gr.Group():
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ def create_bbox_from_mask(
|
|||||||
"""
|
"""
|
||||||
bboxes = []
|
bboxes = []
|
||||||
for mask in masks:
|
for mask in masks:
|
||||||
mask = mask.resize(shape)
|
mask = mask.resize(shape) # noqa: PLW2901
|
||||||
bbox = mask.getbbox()
|
bbox = mask.getbbox()
|
||||||
if bbox is not None:
|
if bbox is not None:
|
||||||
bboxes.append(list(bbox))
|
bboxes.append(list(bbox))
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class ControlNetExt:
|
|||||||
models = self.external_cn.get_models()
|
models = self.external_cn.get_models()
|
||||||
self.cn_models.extend(m for m in models if cn_model_regex.search(m))
|
self.cn_models.extend(m for m in models if cn_model_regex.search(m))
|
||||||
|
|
||||||
def update_scripts_args(
|
def update_scripts_args( # noqa: PLR0913
|
||||||
self,
|
self,
|
||||||
p,
|
p,
|
||||||
model: str,
|
model: str,
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class ControlNetExt:
|
|||||||
def init_controlnet(self):
|
def init_controlnet(self):
|
||||||
self.cn_available = True
|
self.cn_available = True
|
||||||
|
|
||||||
def update_scripts_args(
|
def update_scripts_args( # noqa: PLR0913
|
||||||
self,
|
self,
|
||||||
p,
|
p,
|
||||||
model: str,
|
model: str,
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ select = [
|
|||||||
"N",
|
"N",
|
||||||
"PD",
|
"PD",
|
||||||
"PERF",
|
"PERF",
|
||||||
|
"PL",
|
||||||
"PIE",
|
"PIE",
|
||||||
"PT",
|
"PT",
|
||||||
"PTH",
|
"PTH",
|
||||||
@@ -67,7 +68,7 @@ select = [
|
|||||||
"UP",
|
"UP",
|
||||||
"W",
|
"W",
|
||||||
]
|
]
|
||||||
ignore = ["B905", "E501"]
|
ignore = ["B905", "E501", "PLR2004", "PLW0603"]
|
||||||
unfixable = ["F401"]
|
unfixable = ["F401"]
|
||||||
|
|
||||||
[tool.ruff.lint.isort]
|
[tool.ruff.lint.isort]
|
||||||
|
|||||||
@@ -745,7 +745,7 @@ class AfterDetailerScript(scripts.Script):
|
|||||||
|
|
||||||
return optimal_resolution
|
return optimal_resolution
|
||||||
|
|
||||||
def fix_p2(
|
def fix_p2( # noqa: PLR0913
|
||||||
self, p, p2, pp: PPImage, args: ADetailerArgs, pred: PredictOutput, j: int
|
self, p, p2, pp: PPImage, args: ADetailerArgs, pred: PredictOutput, j: int
|
||||||
):
|
):
|
||||||
seed, subseed = self.get_seed(p)
|
seed, subseed = self.get_seed(p)
|
||||||
|
|||||||
Reference in New Issue
Block a user