apply sonar lint
This commit is contained in:
parent
30978e3e5b
commit
c69e342ee4
|
@ -113,5 +113,5 @@ def blend_inpaint(
|
|||
|
||||
output = process_tile_order(stage.tile_order, source, SizeChart.auto, 1, [outpaint])
|
||||
|
||||
logger.info("final output image size", output.size)
|
||||
logger.info("final output image size: %s", output.size)
|
||||
return output
|
||||
|
|
|
@ -13,7 +13,7 @@ def source_noise(
|
|||
_job: JobContext,
|
||||
_server: ServerContext,
|
||||
_stage: StageParams,
|
||||
params: ImageParams,
|
||||
_params: ImageParams,
|
||||
source: Image.Image,
|
||||
*,
|
||||
size: Size,
|
||||
|
|
|
@ -149,7 +149,7 @@ def fetch_model(
|
|||
if model_format is None:
|
||||
url = urlparse(source)
|
||||
ext = path.basename(url.path)
|
||||
file, ext = path.splitext(ext)
|
||||
_filename, ext = path.splitext(ext)
|
||||
if ext is not None:
|
||||
cache_name += ext
|
||||
else:
|
||||
|
|
|
@ -1397,8 +1397,6 @@ def extract_checkpoint(
|
|||
|
||||
logger.info(result_status)
|
||||
|
||||
return
|
||||
|
||||
|
||||
def convert_diffusion_original(
|
||||
ctx: ConversionContext,
|
||||
|
|
|
@ -214,12 +214,12 @@ def load_tensor(name: str, map_location=None):
|
|||
except Exception as e:
|
||||
try:
|
||||
logger.warning(
|
||||
"failed to load as safetensors file, falling back to torch", e
|
||||
"failed to load as safetensors file, falling back to torch: %s", e
|
||||
)
|
||||
checkpoint = torch.jit.load(name)
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
"failed to load with Torch JIT, falling back to PyTorch", e
|
||||
"failed to load with Torch JIT, falling back to PyTorch: %s", e
|
||||
)
|
||||
checkpoint = torch.load(name, map_location=map_location)
|
||||
checkpoint = (
|
||||
|
|
|
@ -173,7 +173,6 @@ def run_inpaint_pipeline(
|
|||
fill_color: str,
|
||||
tile_order: str,
|
||||
) -> None:
|
||||
# device = job.get_device()
|
||||
progress = job.get_progress_callback()
|
||||
stage = StageParams(tile_order=tile_order)
|
||||
|
||||
|
@ -218,7 +217,6 @@ def run_upscale_pipeline(
|
|||
upscale: UpscaleParams,
|
||||
source: Image.Image,
|
||||
) -> None:
|
||||
# device = job.get_device()
|
||||
progress = job.get_progress_callback()
|
||||
stage = StageParams()
|
||||
|
||||
|
|
|
@ -208,7 +208,6 @@ class DevicePoolExecutor:
|
|||
except ValueError as e:
|
||||
logger.warning("error removing pruned job from pending: %s", e)
|
||||
|
||||
# self.jobs[:] = [job for job in self.jobs if not job.future.done()]
|
||||
recent_count = len(self.recent)
|
||||
if recent_count > self.recent_limit:
|
||||
logger.debug(
|
||||
|
|
|
@ -31,11 +31,10 @@ class ModelCache:
|
|||
|
||||
for i in range(len(self.cache)):
|
||||
t, k, v = self.cache[i]
|
||||
if tag == t:
|
||||
if key != k:
|
||||
logger.debug("updating model cache: %s", tag)
|
||||
self.cache[i] = (tag, key, value)
|
||||
return
|
||||
if tag == t and key != k:
|
||||
logger.debug("updating model cache: %s", tag)
|
||||
self.cache[i] = (tag, key, value)
|
||||
return
|
||||
|
||||
logger.debug("adding new model to cache: %s", tag)
|
||||
self.cache.append((tag, key, value))
|
||||
|
|
Loading…
Reference in New Issue