Skip to content

Commit 8e391b7

Browse files
committed
update z-image docstring
1 parent 28685dd commit 8e391b7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/diffusers/pipelines/z_image/pipeline_z_image.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,14 @@
3939
4040
>>> pipe = ZImagePipeline.from_pretrained("Z-a-o/Z-Image-Turbo", torch_dtype=torch.bfloat16)
4141
>>> pipe.to("cuda")
42+
43+
>>> # Optionally, set the attention backend to flash-attn 2 or 3, default is SDPA in PyTorch.
44+
>>> # (1) Use flash attention 2
45+
>>> # pipe.transformer.set_attention_backend("flash")
46+
>>> # (2) Use flash attention 3
47+
>>> # pipe.transformer.set_attention_backend("_flash_3")
48+
4249
>>> prompt = "一幅为名为“造相「Z-IMAGE-TURBO」”的项目设计的创意海报。画面巧妙地将文字概念视觉化:一辆复古蒸汽小火车化身为巨大的拉链头,正拉开厚厚的冬日积雪,展露出一个生机盎然的春天。"
43-
>>> # Depending on the variant being used, the pipeline call will slightly vary.
44-
>>> # Refer to the pipeline documentation for more details.
4550
>>> image = pipe(
4651
... prompt,
4752
... height=1024,

0 commit comments

Comments
 (0)