File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/diffusers/pipelines/z_image Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 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,
You can’t perform that action at this time.
0 commit comments