diff --git a/pipelines/bria/bria_pipeline.py b/pipelines/bria/bria_pipeline.py index beec4e2dc..6049e3f45 100644 --- a/pipelines/bria/bria_pipeline.py +++ b/pipelines/bria/bria_pipeline.py @@ -237,11 +237,11 @@ class BriaPipeline(FluxPipeline): @replace_example_docstring(EXAMPLE_DOC_STRING) def __call__( self, - prompt: Union[str, List[str]] = None, + prompt: Union[str, List[str]] | None = None, height: Optional[int] = None, width: Optional[int] = None, num_inference_steps: int = 30, - timesteps: List[int] = None, + timesteps: List[int] | None = None, guidance_scale: float = 5, negative_prompt: Optional[Union[str, List[str]]] = None, num_images_per_prompt: Optional[int] = 1, diff --git a/pipelines/bria/bria_utils.py b/pipelines/bria/bria_utils.py index 3cddeafa1..5aed654c2 100644 --- a/pipelines/bria/bria_utils.py +++ b/pipelines/bria/bria_utils.py @@ -99,7 +99,7 @@ def get_by_t5_prompt_embeds( def get_t5_prompt_embeds( tokenizer: T5TokenizerFast , text_encoder: T5EncoderModel, - prompt: Union[str, List[str]] = None, + prompt: Union[str, List[str]] | None = None, num_images_per_prompt: int = 1, max_sequence_length: int = 128, device: Optional[torch.device] = None, @@ -184,7 +184,7 @@ def get_env_prefix(): def compute_density_for_timestep_sampling( - weighting_scheme: str, batch_size: int, logit_mean: float = None, logit_std: float = None, mode_scale: float = None + weighting_scheme: str, batch_size: int, logit_mean: float | None = None, logit_std: float | None = None, mode_scale: float | None = None ): """Compute the density for sampling the timesteps when doing SD3 training. @@ -236,7 +236,7 @@ def get_clip_prompt_embeds( text_encoder_2: CLIPTextModelWithProjection, tokenizer: CLIPTokenizer, tokenizer_2: CLIPTokenizer, - prompt: Union[str, List[str]] = None, + prompt: Union[str, List[str]] | None = None, num_images_per_prompt: int = 1, max_sequence_length: int = 77, device: Optional[torch.device] = None, diff --git a/pipelines/bria/transformer_bria.py b/pipelines/bria/transformer_bria.py index f75cde912..1378a8e16 100644 --- a/pipelines/bria/transformer_bria.py +++ b/pipelines/bria/transformer_bria.py @@ -82,7 +82,7 @@ class BriaTransformer2DModel(ModelMixin, ConfigMixin, PeftAdapterMixin, FromOrig attention_head_dim: int = 128, num_attention_heads: int = 24, joint_attention_dim: int = 4096, - pooled_projection_dim: int = None, + pooled_projection_dim: int | None = None, guidance_embeds: bool = False, axes_dims_rope: List[int] = [16, 56, 56], rope_theta = 10000, diff --git a/pipelines/flex2/__init__.py b/pipelines/flex2/__init__.py index dbb8e2a0d..1ba0a2eba 100644 --- a/pipelines/flex2/__init__.py +++ b/pipelines/flex2/__init__.py @@ -60,7 +60,7 @@ class Flex2Pipeline(FluxControlPipeline): @torch.no_grad() def __call__( self, - prompt: Union[str, List[str]] = None, + prompt: Union[str, List[str]] | None = None, prompt_2: Optional[Union[str, List[str]]] = None, inpaint_image: Optional[PipelineImageInput] = None, inpaint_mask: Optional[PipelineImageInput] = None, diff --git a/pipelines/hidream/pipeline_hidream_image_editing.py b/pipelines/hidream/pipeline_hidream_image_editing.py index c410ec8ac..09cdc4b26 100644 --- a/pipelines/hidream/pipeline_hidream_image_editing.py +++ b/pipelines/hidream/pipeline_hidream_image_editing.py @@ -210,7 +210,7 @@ class HiDreamImageEditingPipeline(DiffusionPipeline, HiDreamImageLoraLoaderMixin def _get_t5_prompt_embeds( self, - prompt: Union[str, List[str]] = None, + prompt: Union[str, List[str]] | None = None, max_sequence_length: int = 128, device: Optional[torch.device] = None, dtype: Optional[torch.dtype] = None, @@ -284,7 +284,7 @@ class HiDreamImageEditingPipeline(DiffusionPipeline, HiDreamImageLoraLoaderMixin def _get_llama3_prompt_embeds( self, - prompt: Union[str, List[str]] = None, + prompt: Union[str, List[str]] | None = None, max_sequence_length: int = 128, device: Optional[torch.device] = None, dtype: Optional[torch.dtype] = None, @@ -760,7 +760,7 @@ class HiDreamImageEditingPipeline(DiffusionPipeline, HiDreamImageLoraLoaderMixin @replace_example_docstring(EXAMPLE_DOC_STRING) def __call__( self, - prompt: Union[str, List[str]] = None, + prompt: Union[str, List[str]] | None = None, prompt_2: Optional[Union[str, List[str]]] = None, prompt_3: Optional[Union[str, List[str]]] = None, prompt_4: Optional[Union[str, List[str]]] = None, diff --git a/pipelines/model_hyimage.py b/pipelines/model_hyimage.py index 307b31d58..4cf9776ee 100644 --- a/pipelines/model_hyimage.py +++ b/pipelines/model_hyimage.py @@ -81,8 +81,8 @@ class HunyuanImage3Wrapper(torch.nn.Module): def __call__( self, prompt: str, - height: int = None, - width: int = None, + height: int | None = None, + width: int | None = None, num_inference_steps: int = 50, num_images_per_prompt: int = 1, guidance_scale: float = 7.5, diff --git a/pipelines/wan/wan_image.py b/pipelines/wan/wan_image.py index bd9923e5b..254ed2fba 100644 --- a/pipelines/wan/wan_image.py +++ b/pipelines/wan/wan_image.py @@ -10,8 +10,8 @@ from modules import devices class WanImagePipeline(diffusers.WanPipeline): def __call__( self, - prompt: Union[str, List[str]] = None, - negative_prompt: Union[str, List[str]] = None, + prompt: Union[str, List[str]] | None = None, + negative_prompt: Union[str, List[str]] | None = None, height: int = 480, width: int = 832, num_frames: int = 81,