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

[PPDiffusers] add_cycle_diffusion_space #4830

Merged
merged 3 commits into from
Feb 20, 2023

Conversation

JunnYu
Copy link
Member

@JunnYu JunnYu commented Feb 16, 2023

PR types

PR changes

Description

# ppdiffusers == 0.11.0
from ppdiffusers import CycleDiffusionPipeline, DDIMScheduler
from ppdiffusers.utils import load_image
import paddle
init_image = load_image("https://paddlenlp.bj.bcebos.com/models/community/CompVis/data/black_colored_car.png")
init_image = init_image.resize((512, 512))

model_id = "CompVis/stable-diffusion-v1-4"
pipe = CycleDiffusionPipeline.from_pretrained(model_id, safety_checker=None, requires_safety_checker=False)
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)

source_prompt = "A black colored car"
prompt = "A blue colored car"

generator = paddle.Generator().manual_seed(0)
output = pipe(
    prompt=prompt,
    source_prompt=source_prompt,
    image=init_image,
    num_inference_steps=100,
    eta=0.1,
    strength=0.85,
    guidance_scale=3,
    source_guidance_scale=1,
    generator=generator,
    output_type="pil",
).images

output[0].save("demo.png")

e0aac071d0bc43a76a2593df989e9695

运行gradio得到的结果:
30a0ab4012a4830cfb615ffb6b170d54

@paddle-bot
Copy link

paddle-bot bot commented Feb 16, 2023

Thanks for your contribution!

@codecov
Copy link

codecov bot commented Feb 16, 2023

Codecov Report

Merging #4830 (6292a3a) into develop (080aeb8) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #4830   +/-   ##
========================================
  Coverage    44.64%   44.64%           
========================================
  Files          446      446           
  Lines        64373    64373           
========================================
  Hits         28742    28742           
  Misses       35631    35631           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@guoshengCS guoshengCS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也请 @joey12300 知晓CycleDiffusion pipeline的修改,FD对应pipeline可能要相应更新

prompt_embeds (`torch.FloatTensor`, *optional*):
Pre-generated text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt weighting. If not
provided, text embeddings will be generated from `prompt` input argument.
negative_prompt_embeds (`torch.FloatTensor`, *optional*):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看着HF的docstr也少了source_prompt参数的描述

@@ -0,0 +1,136 @@
# Copyright 2022 Google LLC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright部分是否适当调整,也在上面加上咱们的

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加上了

guoshengCS
guoshengCS previously approved these changes Feb 17, 2023
@guoshengCS guoshengCS merged commit dde0f05 into PaddlePaddle:develop Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants