Skip to content

Commit 77ec5d0

Browse files
authored
Update pipeline_stg_ltx.py
1 parent efc4255 commit 77ec5d0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

examples/community/pipeline_stg_ltx.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,24 @@
5151
>>> pipe = LTXPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16)
5252
>>> pipe.to("cuda")
5353
54-
>>> prompt = "A woman with long brown hair and light skin smiles at another woman with long blonde hair. The woman with brown hair wears a black jacket and has a small, barely noticeable mole on her right cheek. The camera angle is a close-up, focused on the woman with brown hair's face. The lighting is warm and natural, likely from the setting sun, casting a soft glow on the scene. The scene appears to be real-life footage"
54+
>>> prompt = "A woman with light skin, wearing a blue jacket and a black hat with a veil, looks down and to her right, then back up as she speaks; she has brown hair styled in an updo, light brown eyebrows, and is wearing a white collared shirt under her jacket; the camera remains stationary on her face as she speaks; the background is out of focus, but shows trees and people in period clothing; the scene is captured in real-life footage."
5555
>>> negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"
5656
57+
>>> # Configure STG mode options
58+
>>> stg_applied_layers_idx = [19] # Layer indices from 0 to 41
59+
>>> stg_scale = 1.0
60+
>>> do_rescaling = False
61+
5762
>>> video = pipe(
5863
... prompt=prompt,
5964
... negative_prompt=negative_prompt,
6065
... width=704,
6166
... height=480,
6267
... num_frames=161,
6368
... num_inference_steps=50,
69+
... stg_applied_layers_idx=stg_applied_layers_idx,
70+
... stg_scale=stg_scale,
71+
... do_rescaling=do_rescaling,
6472
... ).frames[0]
6573
>>> export_to_video(video, "output.mp4", fps=24)
6674
```
@@ -869,4 +877,4 @@ def __call__(
869877
if not return_dict:
870878
return (video,)
871879

872-
return LTXPipelineOutput(frames=video)
880+
return LTXPipelineOutput(frames=video)

0 commit comments

Comments
 (0)