Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable Diffusion XL Long Weighted Prompt Pipeline #413

Closed
westfish opened this issue Feb 2, 2024 · 0 comments
Closed

Stable Diffusion XL Long Weighted Prompt Pipeline #413

westfish opened this issue Feb 2, 2024 · 0 comments
Assignees
Labels
HappyOpenSource Pro 快乐开源issue与PR,更具挑战的任务

Comments

@westfish
Copy link
Contributor

westfish commented Feb 2, 2024

Stable Diffusion XL Long Weighted Prompt Pipeline

任务描述

任务背景

  • PaddleMIX PPDiffusers新增 Stable Diffusion XL Long Weighted Prompt Pipeline。

完成步骤

1.参考代码,新增 Stable Diffusion XL Long Weighted Prompt Pipeline
2.保证生成结果对齐

提交内容:

  1. 提交到目录
@LokeZhou LokeZhou added the HappyOpenSource Pro 快乐开源issue与PR,更具挑战的任务 label Feb 27, 2024
westfish pushed a commit that referenced this issue Mar 22, 2024
#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")
```
@luotao1 luotao1 closed this as completed Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HappyOpenSource Pro 快乐开源issue与PR,更具挑战的任务
Projects
None yet
Development

No branches or pull requests

4 participants