Skip to content

Commit efbdd34

Browse files
Apply style fixes
1 parent 4670287 commit efbdd34

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

src/diffusers/pipelines/wan/pipeline_wan.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,13 @@
5252
>>> # Available models: Wan-AI/Wan2.1-T2V-14B-Diffusers, Wan-AI/Wan2.1-T2V-1.3B-Diffusers
5353
>>> model_id = "Wan-AI/Wan2.1-T2V-14B-Diffusers"
5454
>>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
55-
>>> flow_shift = 5.0 # 5.0 for 720P, 3.0 for 480P
56-
>>> scheduler = UniPCMultistepScheduler(prediction_type='flow_prediction', use_flow_sigmas=True, num_train_timesteps=1000, flow_shift=flow_shift)
55+
>>> flow_shift = 5.0 # 5.0 for 720P, 3.0 for 480P
56+
>>> scheduler = UniPCMultistepScheduler(
57+
... prediction_type="flow_prediction",
58+
... use_flow_sigmas=True,
59+
... num_train_timesteps=1000,
60+
... flow_shift=flow_shift,
61+
... )
5762
>>> pipe = WanPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)
5863
>>> pipe.scheduler = scheduler
5964
>>> pipe.to("cuda")
@@ -68,7 +73,7 @@
6873
... width=1280,
6974
... num_frames=81,
7075
... guidance_scale=5.0,
71-
... ).frames[0]
76+
... ).frames[0]
7277
>>> export_to_video(output, "output.mp4", fps=16)
7378
```
7479
"""

src/diffusers/pipelines/wan/pipeline_wan_i2v.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,13 @@
5353
5454
>>> # Available models: Wan-AI/Wan2.1-I2V-14B-480P-Diffusers, Wan-AI/Wan2.1-I2V-14B-720P-Diffusers
5555
>>> model_id = "Wan-AI/Wan2.1-I2V-14B-480P-Diffusers"
56-
>>> image_encoder = CLIPVisionModel.from_pretrained(model_id, subfolder="image_encoder", torch_dtype=torch.float32)
56+
>>> image_encoder = CLIPVisionModel.from_pretrained(
57+
... model_id, subfolder="image_encoder", torch_dtype=torch.float32
58+
... )
5759
>>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
58-
>>> pipe = WanImageToVideoPipeline.from_pretrained(model_id, vae=vae, image_encoder=image_encoder, torch_dtype=torch.bfloat16)
60+
>>> pipe = WanImageToVideoPipeline.from_pretrained(
61+
... model_id, vae=vae, image_encoder=image_encoder, torch_dtype=torch.bfloat16
62+
... )
5963
>>> pipe.to("cuda")
6064
6165
>>> image = load_image(
@@ -74,7 +78,13 @@
7478
>>> negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"
7579
7680
>>> output = pipe(
77-
... image=image, prompt=prompt, negative_prompt=negative_prompt, height=height, width=width, num_frames=81, guidance_scale=5.0
81+
... image=image,
82+
... prompt=prompt,
83+
... negative_prompt=negative_prompt,
84+
... height=height,
85+
... width=width,
86+
... num_frames=81,
87+
... guidance_scale=5.0,
7888
... ).frames[0]
7989
>>> export_to_video(output, "output.mp4", fps=16)
8090
```

0 commit comments

Comments
 (0)