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

About Playground-v2.5-1024 model. #6

Closed
yiboz2001 opened this issue Apr 14, 2024 · 3 comments
Closed

About Playground-v2.5-1024 model. #6

yiboz2001 opened this issue Apr 14, 2024 · 3 comments

Comments

@yiboz2001
Copy link

Hi!
Thanks for your amazing work.

Playground-v2.5-1024 is a stronger T2I model based on the SD-XL architecture.
(https://huggingface.co/playgroundai/playground-v2.5-1024px-aesthetic)
I try to use the follow code to speed up the model, but the result seems terrible.

import torch
from diffusers import StableDiffusionXLPipeline

pipe = StableDiffusionXLPipeline.from_pretrained(
        "playgroundai/playground-v2.5-1024px-aesthetic",
        torch_dtype=torch.float16,
        variant="fp16",
        use_safetensors=True,
)

from tgate import TgateSDXLLoader
gate_step = 10
inference_step = 25
pipe = TgateSDXLLoader(
       pipe,
       gate_step=gate_step,
       num_inference_steps=inference_step,
)
pipe = pipe.to("cuda")

prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k."
        
image = pipe.tgate(
        prompt,
        gate_step=gate_step,
        num_inference_steps=inference_step
).images[0]
image.save(f"{prompt}.png") 

Astronaut in a jungle, cold color palette, muted colors, detailed, 8k

Is there any way to solve the problem?
I am looking for your reply.

@WentianZhang-ML
Copy link
Collaborator

Hi, thanks for your attention!

We supplemented the conditional check for denormalizing the latents in L472 to solve the problem.

Please upgrade the tgate to the version 0.1.1 by pip install --upgrade tgate and have a try again.

The example of playgroundai sets num_inference_steps as 50, so we recommend setting gate_step as 25 or 30 when num_inference_steps is 50 for better results.

BTW, you can also try TgateSDXLDeepCacheLoader to further improve the efficiency.

If you find our work inspiring, please consider giving a star!

@yiboz2001
Copy link
Author

Hi, thanks for your attention!

We supplemented the conditional check for denormalizing the latents in L472 to solve the problem.

Please upgrade the tgate to the version 0.1.1 by pip install --upgrade tgate and have a try again.

The example of playgroundai sets num_inference_steps as 50, so we recommend setting gate_step as 25 or 30 when num_inference_steps is 50 for better results.

BTW, you can also try TgateSDXLDeepCacheLoader to further improve the efficiency.

If you find our work inspiring, please consider giving a star!

The new version works! Thanks again.
Both TgateSDXLDeepCacheLoader and TgateSDXLLoader speed the process a lot with the same qualitity.
I have starred all projects out of my respect!

@WentianZhang-ML
Copy link
Collaborator

Great, thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants