mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
lint set minimum to py310 and update rules
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
analyse-fallback-blocks=no
|
||||
clear-cache-post-run=no
|
||||
extension-pkg-allow-list=
|
||||
prefer-stubs=yes
|
||||
extension-pkg-whitelist=
|
||||
fail-on=
|
||||
fail-under=10
|
||||
@@ -69,11 +70,11 @@ ignore-patterns=.*test*.py$,
|
||||
.*_model_arch.py*,
|
||||
.*_model_arch_v2.py$,
|
||||
ignored-modules=
|
||||
jobs=0
|
||||
jobs=8
|
||||
limit-inference-results=100
|
||||
load-plugins=
|
||||
persistent=yes
|
||||
py-version=3.9
|
||||
persistent=no
|
||||
py-version=3.10
|
||||
recursive=no
|
||||
source-roots=
|
||||
unsafe-load-any-extension=no
|
||||
@@ -207,6 +208,8 @@ disable=abstract-method,
|
||||
unnecessary-lambda-assigment,
|
||||
unnecessary-lambda,
|
||||
unused-wildcard-import,
|
||||
unpacking-non-sequence,
|
||||
unsubscriptable-object,
|
||||
useless-return,
|
||||
use-dict-literal,
|
||||
use-symbolic-message-instead,
|
||||
|
||||
+1
-1
@@ -339,7 +339,7 @@ def outpaint(input_image: Image.Image, outpaint_type: str = 'Edge'):
|
||||
debug(f'Run outpaint: fn={fn}') # pylint: disable=protected-access
|
||||
image = cv2.cvtColor(np.array(input_image), cv2.COLOR_RGB2BGR)
|
||||
h0, w0 = image.shape[:2]
|
||||
empty = (image == 0).all(axis=2)
|
||||
empty = (image == 0).all(axis=2) # pylint: disable=no-member
|
||||
y0, x0 = np.where(~empty) # non empty
|
||||
x1, x2 = min(x0), max(x0)
|
||||
y1, y2 = min(y0), max(y0)
|
||||
|
||||
@@ -55,7 +55,7 @@ def edge_detect_for_pixelart(image: PipelineImageInput, image_weight: float = 1.
|
||||
block_height = height // block_size
|
||||
block_width = width // block_size
|
||||
|
||||
min_pool = -torch.nn.functional.max_pool2d(-new_image, block_size, 1, block_size//2, 1, False, False)
|
||||
min_pool = 0 - torch.nn.functional.max_pool2d(-new_image, block_size, 1, block_size//2, 1, False, False)
|
||||
min_pool = min_pool[:, :, :height, :width]
|
||||
|
||||
greyscale = (new_image[:,0,:,:] * 0.299).add_(new_image[:,1,:,:], alpha=0.587).add_(new_image[:,2,:,:], alpha=0.114)
|
||||
|
||||
@@ -482,7 +482,7 @@ class SDNQQuantizer(DiffusersQuantizer, HfQuantizer):
|
||||
param_value: "torch.Tensor",
|
||||
param_name: str,
|
||||
return_true: bool = True,
|
||||
*args, **kwargs, # pylint: disable=unused-argument
|
||||
*args, **kwargs, # pylint: disable=unused-argument,keyword-arg-before-vararg
|
||||
):
|
||||
if return_true:
|
||||
return True
|
||||
|
||||
@@ -42,7 +42,7 @@ def load_hyimage3(checkpoint_info, diffusers_load_config={}): # pylint: disable=
|
||||
sd_models.hf_auth_check(checkpoint_info)
|
||||
shared.log.debug(f'Load model: type=HunyuanImage3 repo="{repo_id}" offload={shared.opts.diffusers_offload_mode} dtype={devices.dtype}')
|
||||
|
||||
from sdnq import SDNQConfig # import sdnq to register it into transformers
|
||||
from sdnq import SDNQConfig # pylint: disable=unused-import
|
||||
pipe = transformers.AutoModelForCausalLM.from_pretrained(
|
||||
repo_id,
|
||||
attn_implementation="sdpa",
|
||||
|
||||
@@ -150,8 +150,8 @@ class NudeDetector:
|
||||
return background
|
||||
if fg_channels < 4: # make sure that overlay is rgba
|
||||
log.warning('NudeNet overlay image does not have alpha channel')
|
||||
foreground = cv2.cvtColor(foreground, cv2.COLOR_RGB2RGBA)
|
||||
foreground[:, :, 3] = cv2.cvtColor(foreground, cv2.COLOR_BGR2GRAY)
|
||||
foreground_color = cv2.cvtColor(foreground, cv2.COLOR_RGB2RGBA)
|
||||
foreground[:, :, 3] = cv2.cvtColor(foreground_color, cv2.COLOR_BGR2GRAY)
|
||||
fg_h, fg_w, fg_channels = foreground.shape
|
||||
if x_offset is None: # center by default
|
||||
x_offset = (bg_w - fg_w) // 2
|
||||
|
||||
Reference in New Issue
Block a user