diff --git a/cli/localize.js b/cli/localize.js index da870d455..12d289867 100755 --- a/cli/localize.js +++ b/cli/localize.js @@ -7,9 +7,10 @@ const { GoogleGenerativeAI } = require('@google/generative-ai'); const api_key = process.env.GOOGLE_AI_API_KEY; const model = 'gemini-2.5-flash'; -const prompt = ` -// eslint-disable-next-line max-len -Translate attached JSON from English to {language} using following rules: fields id, label and reload should be preserved from original, field localized should be a translated version of field label and field hint should be translated in-place. if field is less than 3 characters, do not translate it and keep it as is. Every JSON entry should have id, label, localized, reload and hint fields. Output should be pure JSON without any additional text. To better match translation, context of the text is related to Stable Diffusion and topic of Generative AI.`; +const prompt = `Translate attached JSON from English to {language} using following rules: fields id, label and reload should be preserved from original, field localized should be a translated version of field label and field hint should be translated in-place. +if field is less than 3 characters, do not translate it and keep it as is. +Every JSON entry should have id, label, localized, reload and hint fields. +Output should be pure JSON without any additional text. To better match translation, context of the text is related to Stable Diffusion and topic of Generative AI.`; const languages = { hr: 'Croatian', de: 'German', diff --git a/modules/sdnq/__init__.py b/modules/sdnq/__init__.py index 71db2127f..6ba49cbb1 100644 --- a/modules/sdnq/__init__.py +++ b/modules/sdnq/__init__.py @@ -440,7 +440,7 @@ class SDNQQuantizer(DiffusersQuantizer): """ return missing_keys - def update_state_dict_with_metadata(self, state_dict: dict, metadata: dict) -> dict: + def update_state_dict_with_metadata(self, state_dict: dict, metadata: dict) -> dict: # pylint: disable=unused-argument """ needed for transformers compatibilty, no-op function """ diff --git a/modules/ui_control.py b/modules/ui_control.py index ecfe1fa01..a1c77848d 100644 --- a/modules/ui_control.py +++ b/modules/ui_control.py @@ -211,7 +211,7 @@ def create_ui(_blocks: gr.Blocks=None): gr.HTML('Output

') with gr.Tabs(elem_classes=['control-tabs'], elem_id='control-tab-output') as output_tabs: with gr.Tab('Gallery', id='out-gallery'): - output_gallery, output_gen_info, _output_html_info, _output_html_info_formatted, output_html_log = ui_common.create_output_panel("control", preview=False, prompt=prompt, height=gr_height, result_info=result_txt) + output_gallery, _output_gen_info, _output_html_info, _output_html_info_formatted, output_html_log = ui_common.create_output_panel("control", preview=False, prompt=prompt, height=gr_height, result_info=result_txt) with gr.Tab('Image', id='out-image'): output_image = gr.Image(label="Output", show_label=False, type="pil", interactive=False, tool="editor", height=gr_height, elem_id='control_output_image', elem_classes=['control-image']) with gr.Tab('Video', id='out-video'): diff --git a/scripts/daam/hook.py b/scripts/daam/hook.py index f82762c4e..7c2866b63 100644 --- a/scripts/daam/hook.py +++ b/scripts/daam/hook.py @@ -1,4 +1,4 @@ -from typing import List, Generic, TypeVar, Callable, Union, Any +from typing import List, Generic, TypeVar import functools import itertools @@ -23,7 +23,7 @@ class ObjectHooker(Generic[ModuleType]): def __init__(self, module: ModuleType): self.module: ModuleType = module self.hooked = False - self.old_state = dict() + self.old_state = {} def __enter__(self): self.hook() @@ -36,7 +36,7 @@ class ObjectHooker(Generic[ModuleType]): if self.hooked: raise RuntimeError('Already hooked module') - self.old_state = dict() + self.old_state = {} self.hooked = True self._hook_impl() diff --git a/scripts/daam/trace.py b/scripts/daam/trace.py index 1b6a6cd3f..625e3d402 100644 --- a/scripts/daam/trace.py +++ b/scripts/daam/trace.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import List, Type, Any, Dict, Tuple, Union +from typing import List, Type, Any, Dict, Union import math from diffusers import StableDiffusionPipeline, StableDiffusionXLPipeline diff --git a/scripts/daam/utils.py b/scripts/daam/utils.py index 8cfde13f2..15e2c1b5e 100644 --- a/scripts/daam/utils.py +++ b/scripts/daam/utils.py @@ -10,7 +10,6 @@ import matplotlib.pyplot as plt import numpy as np import spacy import torch -import torch.nn.functional as F __all__ = ['set_seed', 'compute_token_merge_indices', 'plot_mask_heat_map', 'cached_nlp', 'cache_dir', 'auto_device', 'auto_autocast'] @@ -102,7 +101,6 @@ def cached_nlp(prompt: str, type='en_core_web_md'): try: nlp = spacy.load(type) except OSError: - import os os.system(f'python -m spacy download {type}') nlp = spacy.load(type)