Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Stable Diffusion XL Long Weighted Prompt Pipeline (PaddlePaddle#461)
PaddlePaddle#413 paddle ![image](https://github.com/PaddlePaddle/PaddleMIX/assets/4617245/938e44c1-a0c1-4a34-8496-f63bc1592673) torch ![torch_out](https://github.com/PaddlePaddle/PaddleMIX/assets/4617245/de1be876-c3bb-4614-bca0-46a150f7d7fa) paddle, torch生成图一致 torch 代码 ``` from diffusers import DiffusionPipeline import torch pipe = DiffusionPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0" , torch_dtype = torch.float16 , use_safetensors = True , variant = "fp16" , custom_pipeline = "lpw_stable_diffusion_xl", ) prompt = "photo of a cute (white) cat running on the grass"*20 prompt2 = "chasing (birds:1.5)"*20 prompt = f"{prompt},{prompt2}" neg_prompt = "blur, low quality, carton, animate" pipe.to("cuda") images = pipe( prompt = prompt , negative_prompt = neg_prompt , generator=torch.Generator("cuda").manual_seed(452) ).images[0] images.save("torch_out.png") ```
- Loading branch information