Views
No views yet

1import torch
2from diffusers import PixArtAlphaPipeline, LCMScheduler, Transformer2DModel
3
4transformer = Transformer2DModel.from_pretrained(
5 "Luo-Yihong/yoso_pixart1024", torch_dtype=torch.float16).to('cuda')
6
7pipe = PixArtAlphaPipeline.from_pretrained("PixArt-alpha/PixArt-XL-2-512x512",
8 transformer=transformer,
9 torch_dtype=torch.float16, use_safetensors=True)
10
11pipe = pipe.to('cuda')
12pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
13pipe.scheduler.config.prediction_type = "v_prediction"
14generator = torch.manual_seed(318)
15imgs = pipe(prompt="Pirate ship trapped in a cosmic maelstrom nebula, rendered in cosmic beach whirlpool engine, volumetric lighting, spectacular, ambient lights, light pollution, cinematic atmosphere, art nouveau style, illustration art artwork by SenseiJaye, intricate detail.",
16 num_inference_steps=1,
17 num_images_per_prompt = 1,
18 generator = generator,
19 guidance_scale=1.,
20 )[0]
21imgs[0]
@misc{luo2024sample,
title={You Only Sample Once: Taming One-Step Text-to-Image Synthesis by Self-Cooperative Diffusion GANs},
author={Yihong Luo and Xiaolong Chen and Xinghua Qu and Jing Tang},
year={2024},
eprint={2403.12931},
archivePrefix={arXiv},
primaryClass={cs.CV}
}