Skip to content

Commit 3132bc2

Browse files
committed
adding parity test file
1 parent 520f7a3 commit 3132bc2

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

parity_ltx2_maxdiffusion.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,19 @@ def main():
130130
pipe = LTX2Pipeline.from_pretrained(config)
131131

132132
prompt = getattr(config, "prompt", "A man in a brightly lit room...")
133-
# config can sometimes parse things as lists rather than strings if they contain commas
134-
if isinstance(prompt, list):
135-
prompt = " ".join([str(p) for p in prompt])
136-
elif isinstance(prompt, tuple):
137-
prompt = " ".join([str(p) for p in prompt])
133+
if not isinstance(prompt, str):
134+
if isinstance(prompt, (list, tuple)):
135+
prompt = ", ".join(str(p) for p in prompt)
136+
else:
137+
prompt = str(prompt)
138138

139139
negative_prompt = getattr(config, "negative_prompt", "shaky, glitchy, low quality...")
140-
if isinstance(negative_prompt, list):
141-
negative_prompt = " ".join([str(p) for p in negative_prompt])
142-
elif isinstance(negative_prompt, tuple):
143-
negative_prompt = " ".join([str(p) for p in negative_prompt])
140+
if not isinstance(negative_prompt, str):
141+
if isinstance(negative_prompt, (list, tuple)):
142+
# Re-assemble commas if it was parsed as a list by commas
143+
negative_prompt = ", ".join(str(p) for p in negative_prompt)
144+
else:
145+
negative_prompt = str(negative_prompt)
144146
height = getattr(config, "height", 512)
145147
width = getattr(config, "width", 768)
146148
num_frames = getattr(config, "num_frames", 121)

0 commit comments

Comments
 (0)