Skip to content

Commit df63133

Browse files
authored
Merge branch 'main' into to-single-file/wan
2 parents c857a8a + b9e9965 commit df63133

File tree

5 files changed

+39
-5
lines changed

5 files changed

+39
-5
lines changed

src/diffusers/modular_pipelines/modular_pipeline.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ class ModularPipelineBlocks(ConfigMixin, PushToHubMixin):
323323
"""
324324

325325
config_name = "config.json"
326+
model_name = None
326327

327328
@classmethod
328329
def _get_signature_keys(cls, obj):
@@ -333,6 +334,14 @@ def _get_signature_keys(cls, obj):
333334

334335
return expected_modules, optional_parameters
335336

337+
@property
338+
def expected_components(self) -> List[ComponentSpec]:
339+
return []
340+
341+
@property
342+
def expected_configs(self) -> List[ConfigSpec]:
343+
return []
344+
336345
@classmethod
337346
def from_pretrained(
338347
cls,
@@ -358,7 +367,9 @@ def from_pretrained(
358367
trust_remote_code, pretrained_model_name_or_path, has_remote_code
359368
)
360369
if not (has_remote_code and trust_remote_code):
361-
raise ValueError("TODO")
370+
raise ValueError(
371+
"Selected model repository does not happear to have any custom code or does not have a valid `config.json` file."
372+
)
362373

363374
class_ref = config["auto_map"][cls.__name__]
364375
module_file, class_name = class_ref.split(".")
@@ -367,7 +378,6 @@ def from_pretrained(
367378
pretrained_model_name_or_path,
368379
module_file=module_file,
369380
class_name=class_name,
370-
is_modular=True,
371381
**hub_kwargs,
372382
**kwargs,
373383
)

src/diffusers/modular_pipelines/modular_pipeline_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ComponentSpec:
9393
config: Optional[FrozenDict] = None
9494
# YiYi Notes: should we change it to pretrained_model_name_or_path for consistency? a bit long for a field name
9595
repo: Optional[Union[str, List[str]]] = field(default=None, metadata={"loading": True})
96-
subfolder: Optional[str] = field(default=None, metadata={"loading": True})
96+
subfolder: Optional[str] = field(default="", metadata={"loading": True})
9797
variant: Optional[str] = field(default=None, metadata={"loading": True})
9898
revision: Optional[str] = field(default=None, metadata={"loading": True})
9999
default_creation_method: Literal["from_config", "from_pretrained"] = "from_pretrained"

src/diffusers/pipelines/dit/pipeline_dit.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ class DiTPipeline(DiffusionPipeline):
4646
4747
Parameters:
4848
transformer ([`DiTTransformer2DModel`]):
49-
A class conditioned `DiTTransformer2DModel` to denoise the encoded image latents.
49+
A class conditioned `DiTTransformer2DModel` to denoise the encoded image latents. Initially published as
50+
[`Transformer2DModel`](https://huggingface.co/facebook/DiT-XL-2-256/blob/main/transformer/config.json#L2)
51+
in the config, but the mismatch can be ignored.
5052
vae ([`AutoencoderKL`]):
5153
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.
5254
scheduler ([`DDIMScheduler`]):

src/diffusers/pipelines/pixart_alpha/pipeline_pixart_alpha.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ class PixArtAlphaPipeline(DiffusionPipeline):
256256
Tokenizer of class
257257
[T5Tokenizer](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Tokenizer).
258258
transformer ([`PixArtTransformer2DModel`]):
259-
A text conditioned `PixArtTransformer2DModel` to denoise the encoded image latents.
259+
A text conditioned `PixArtTransformer2DModel` to denoise the encoded image latents. Initially published as
260+
[`Transformer2DModel`](https://huggingface.co/PixArt-alpha/PixArt-XL-2-1024-MS/blob/main/transformer/config.json#L2)
261+
in the config, but the mismatch can be ignored.
260262
scheduler ([`SchedulerMixin`]):
261263
A scheduler to be used in combination with `transformer` to denoise the encoded image latents.
262264
"""

src/diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,26 @@ def retrieve_timesteps(
185185
class PixArtSigmaPipeline(DiffusionPipeline):
186186
r"""
187187
Pipeline for text-to-image generation using PixArt-Sigma.
188+
189+
This model inherits from [`DiffusionPipeline`]. Check the superclass documentation for the generic methods the
190+
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)
191+
192+
Args:
193+
vae ([`AutoencoderKL`]):
194+
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.
195+
text_encoder ([`T5EncoderModel`]):
196+
Frozen text-encoder. PixArt-Alpha uses
197+
[T5](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5EncoderModel), specifically the
198+
[t5-v1_1-xxl](https://huggingface.co/PixArt-alpha/PixArt-alpha/tree/main/t5-v1_1-xxl) variant.
199+
tokenizer (`T5Tokenizer`):
200+
Tokenizer of class
201+
[T5Tokenizer](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Tokenizer).
202+
transformer ([`PixArtTransformer2DModel`]):
203+
A text conditioned `PixArtTransformer2DModel` to denoise the encoded image latents. Initially published as
204+
[`Transformer2DModel`](https://huggingface.co/PixArt-alpha/PixArt-Sigma-XL-2-1024-MS/blob/main/transformer/config.json#L2)
205+
in the config, but the mismatch can be ignored.
206+
scheduler ([`SchedulerMixin`]):
207+
A scheduler to be used in combination with `transformer` to denoise the encoded image latents.
188208
"""
189209

190210
bad_punct_regex = re.compile(

0 commit comments

Comments
 (0)