Views
No views yet
1from diffusers import PixArtSigmaPipeline
2import torch
3
4# Load pipeline
5pipe = PixArtSigmaPipeline.from_pretrained(
6 "PixArt-alpha/PixArt-Sigma-XL-2-1024-MS",
7 torch_dtype=torch.float16
8).to("cuda")
9
10# Load LoRA weights
11pipe.load_lora_weights("matthew816/pixart-lora-anime")
12
13# Generate image from text
14prompt = "anime style, a cat sitting on a chair"
15image = pipe(
16 prompt=prompt,
17 num_inference_steps=20,
18 guidance_scale=4.5
19).images[0]
20image.save("generated_anime_image.png")1@article{chen2024pixart,
2 title={PixArt-Σ: Weak-to-Strong Training of Diffusion Transformer for 4K Text-to-Image Generation},
3 author={Chen, Junsong and others},
4 journal={arXiv preprint arXiv:2403.04692},
5 year={2024}
6}