Skip to content

Commit c5c5e12

Browse files
committed
improve marigold video processing example
1 parent 1e97e03 commit c5c5e12

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/source/en/using-diffusers/marigold_usage.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,14 @@ corresponding to the previous frame prediction give sufficiently smooth results,
380380

381381
```python
382382
import imageio
383-
from PIL import Image
384-
from tqdm import tqdm
385383
import diffusers
386384
import torch
385+
from diffusers.models.attention_processor import AttnProcessor2_0
386+
from PIL import Image
387+
from tqdm import tqdm
387388

388389
device = "cuda"
389-
path_in = "obama.mp4"
390+
path_in = "https://huggingface.co/spaces/prs-eth/marigold-lcm/resolve/c7adb5427947d2680944f898cd91d386bf0d4924/files/video/obama.mp4"
390391
path_out = "obama_depth.gif"
391392

392393
pipe = diffusers.MarigoldDepthPipeline.from_pretrained(
@@ -395,6 +396,9 @@ pipe = diffusers.MarigoldDepthPipeline.from_pretrained(
395396
pipe.vae = diffusers.AutoencoderTiny.from_pretrained(
396397
"madebyollin/taesd", torch_dtype=torch.float16
397398
).to(device)
399+
pipe.unet.set_attn_processor(AttnProcessor2_0())
400+
pipe.vae = torch.compile(pipe.vae, mode="reduce-overhead", fullgraph=True)
401+
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
398402
pipe.set_progress_bar_config(disable=True)
399403

400404
with imageio.get_reader(path_in) as reader:

0 commit comments

Comments
 (0)