Skip to content

Commit 2e978ad

Browse files
committed
Run Ruff
1 parent c8f84d2 commit 2e978ad

File tree

6 files changed

+8
-11
lines changed

6 files changed

+8
-11
lines changed

invokeai/app/invocations/flux_text_to_image.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,7 @@ def _run_diffusion(
144144
# if the cache is not empty.
145145
# context.models._services.model_manager.load.ram_cache.make_room(24 * 2**30)
146146

147-
with (
148-
transformer_info as transformer,
149-
scheduler_info as scheduler
150-
):
147+
with transformer_info as transformer, scheduler_info as scheduler:
151148
assert isinstance(transformer, FluxTransformer2DModel)
152149
assert isinstance(scheduler, FlowMatchEulerDiscreteScheduler)
153150

invokeai/app/invocations/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ class CLIPField(BaseModel):
6060
loras: List[LoRAField] = Field(description="LoRAs to apply on model loading")
6161

6262

63-
6463
class TransformerField(BaseModel):
6564
transformer: ModelIdentifierField = Field(description="Info to load Transformer submodel")
6665
scheduler: ModelIdentifierField = Field(description="Info to load scheduler submodel")
6766

67+
6868
class T5EncoderField(BaseModel):
6969
tokenizer: ModelIdentifierField = Field(description="Info to load tokenizer submodel")
7070
text_encoder: ModelIdentifierField = Field(description="Info to load text_encoder submodel")

invokeai/backend/model_manager/load/model_util.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def calc_model_size_by_data(logger: logging.Logger, model: AnyModel) -> int:
5050
return model.calc_size()
5151
elif isinstance(
5252
model,
53-
(
54-
T5TokenizerFast,
55-
),
53+
(T5TokenizerFast,),
5654
):
5755
return len(model)
5856
else:

invokeai/backend/model_manager/util/select_hf_files.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def filter_files(
5454
"lora_weights.safetensors",
5555
"weights.pb",
5656
"onnx_data",
57-
"spiece.model", # Added for `black-forest-labs/FLUX.1-schnell`.
57+
"spiece.model", # Added for `black-forest-labs/FLUX.1-schnell`.
5858
)
5959
):
6060
paths.append(file)

invokeai/backend/quantization/fast_quantized_diffusion_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class FastQuantizedDiffusersModel(QuantizedDiffusersModel):
2121
@classmethod
22-
def from_pretrained(cls, model_name_or_path: Union[str, os.PathLike], base_class = FluxTransformer2DModel, **kwargs):
22+
def from_pretrained(cls, model_name_or_path: Union[str, os.PathLike], base_class=FluxTransformer2DModel, **kwargs):
2323
"""We override the `from_pretrained()` method in order to use our custom `requantize()` implementation."""
2424
base_class = base_class or cls.base_class
2525
if base_class is None:

invokeai/backend/quantization/fast_quantized_transformers_model.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
class FastQuantizedTransformersModel(QuantizedTransformersModel):
1717
@classmethod
18-
def from_pretrained(cls, model_name_or_path: Union[str, os.PathLike], auto_class = AutoModelForTextEncoding, **kwargs):
18+
def from_pretrained(
19+
cls, model_name_or_path: Union[str, os.PathLike], auto_class=AutoModelForTextEncoding, **kwargs
20+
):
1921
"""We override the `from_pretrained()` method in order to use our custom `requantize()` implementation."""
2022
auto_class = auto_class or cls.auto_class
2123
if auto_class is None:

0 commit comments

Comments
 (0)