mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
stricter lint rules
This commit is contained in:
+1
-1
@@ -350,7 +350,7 @@ def run_modelconvert(model, checkpoint_formats, precision, conv_type, custom_nam
|
||||
ema_k = "___"
|
||||
try:
|
||||
ema_k = "model_ema." + k[6:].replace(".", "")
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
if ema_k in state_dict:
|
||||
_hf(k, state_dict[ema_k])
|
||||
|
||||
@@ -239,7 +239,7 @@ class StableDiffusionProcessing:
|
||||
pass
|
||||
|
||||
def sample(self, conditioning, unconditional_conditioning, seeds, subseeds, subseed_strength, prompts):
|
||||
raise NotImplementedError()
|
||||
raise NotImplementedError
|
||||
|
||||
def close(self):
|
||||
self.sampler = None # pylint: disable=attribute-defined-outside-init
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@ import zipfile
|
||||
import re
|
||||
|
||||
import torch
|
||||
import numpy
|
||||
import numpy as np
|
||||
import _codecs
|
||||
|
||||
# PyTorch 1.13 and later have _TypedStorage renamed to TypedStorage
|
||||
@@ -43,9 +43,9 @@ class RestrictedUnpickler(pickle.Unpickler):
|
||||
if module == 'torch.nn.modules.container' and name in ['ParameterDict']:
|
||||
return getattr(torch.nn.modules.container, name)
|
||||
if module == 'numpy.core.multiarray' and name in ['scalar', '_reconstruct']:
|
||||
return getattr(numpy.core.multiarray, name)
|
||||
return getattr(np.core.multiarray, name)
|
||||
if module == 'numpy' and name in ['dtype', 'ndarray']:
|
||||
return getattr(numpy, name)
|
||||
return getattr(np, name)
|
||||
if module == '_codecs' and name == 'encode':
|
||||
return encode
|
||||
if module == "pytorch_lightning.callbacks" and name == 'model_checkpoint':
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ class Script:
|
||||
|
||||
def title(self):
|
||||
"""this function should return the title of the script. This is what will be displayed in the dropdown menu."""
|
||||
raise NotImplementedError()
|
||||
raise NotImplementedError
|
||||
|
||||
def ui(self, is_img2img):
|
||||
"""this function should create gradio UI elements. See https://gradio.app/docs/#components
|
||||
|
||||
+3
-3
@@ -556,9 +556,9 @@ def create_ui():
|
||||
with gr.TabItem('Batch', id='batch', elem_id="img2img_batch_tab") as tab_batch:
|
||||
hidden = '<br>Disabled when launched with --hide-ui-dir-config.' if modules.shared.cmd_opts.hide_ui_dir_config else ''
|
||||
gr.HTML(
|
||||
"<p style='padding-bottom: 1em;' class=\"text-gray-500\">Process images in a directory on the same machine where the server is running." +
|
||||
"<br>Use an empty output directory to save pictures normally instead of writing to the output directory." +
|
||||
"<br>Add inpaint batch mask directory to enable inpaint batch processing."
|
||||
"<p style='padding-bottom: 1em;' class=\"text-gray-500\">Process images in a directory on the same machine where the server is running" +
|
||||
"<br>Use an empty output directory to save pictures normally instead of writing to the output directory" +
|
||||
"<br>Add inpaint batch mask directory to enable inpaint batch processing"
|
||||
f"{hidden}</p>"
|
||||
)
|
||||
img2img_batch_input_dir = gr.Textbox(label="Inpaint batch input directory", **modules.shared.hide_dirs, elem_id="img2img_batch_input_dir")
|
||||
|
||||
@@ -143,7 +143,7 @@ class ExtraNetworksPage:
|
||||
return ''
|
||||
|
||||
def list_items(self):
|
||||
raise NotImplementedError()
|
||||
raise NotImplementedError
|
||||
|
||||
def allowed_directories_for_previews(self):
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user