Skip to content

Commit a46524b

Browse files
committed
mellon config save keep key order
1 parent b988d53 commit a46524b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/diffusers/modular_pipelines/mellon_node_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def image_latents(cls, display: str = "input") -> "MellonParam":
7070

7171
@classmethod
7272
def image_latents_with_strength(cls) -> "MellonParam":
73-
return cls(name="image_latents", label="Image Latents", type="latents", display="input", onChange={False: ["height", "width"], True: ["strength"]})
73+
return cls(name="image_latents", label="Image Latents", type="latents", display="input", onChange={"false": ["height", "width"], "true": ["strength"]})
7474

7575
@classmethod
7676
def latents_preview(cls) -> "MellonParam":
@@ -391,7 +391,7 @@ def __init__(
391391

392392
def __repr__(self) -> str:
393393
node_types = list(self.node_params.keys())
394-
return f"MellonPipelineConfig(label={self.label!r}, nodes={node_types})"
394+
return f"MellonPipelineConfig(label={self.label!r}, default_repo={self.default_repo!r}, default_dtype={self.default_dtype!r}, node_params={node_types})"
395395

396396
def to_dict(self) -> Dict[str, Any]:
397397
"""Convert to a JSON-serializable dictionary."""
@@ -418,7 +418,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "MellonPipelineConfig":
418418

419419
def to_json_string(self) -> str:
420420
"""Serialize to JSON string."""
421-
return json.dumps(self.to_dict(), indent=2, sort_keys=True) + "\n"
421+
return json.dumps(self.to_dict(), indent=2, sort_keys=False) + "\n"
422422

423423
def to_json_file(self, json_file_path: Union[str, os.PathLike]):
424424
"""Save to a JSON file."""

0 commit comments

Comments
 (0)