Git Product home page Git Product logo

Comments (8)

TonyLianLong avatar TonyLianLong commented on June 8, 2024

I believe it will re-encode so it's applied on the latents.

The implementation shows that images are transformed to latents prior to processing: https://github.com/huggingface/diffusers/blob/af48bf200860d8b83fe3be92b2d7ae556a3b4111/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py#L841

I believe this is their recommended way to do refinement, as this is in their PR examples.

from stable-diffusion-xl-demo.

lifeisboringsoprogramming avatar lifeisboringsoprogramming commented on June 8, 2024

Thank you for your reply
The PR use

images = pipe(prompt=prompt, output_type="latent").images

before the refiner

there is an output_type="latent" parameter

How much VRAM is needed if we move the pipe to cuda instead of enable_model_cpu_offload?

I do not have enough VRAM so I cannot know

Thanks

from stable-diffusion-xl-demo.

TonyLianLong avatar TonyLianLong commented on June 8, 2024

there is an output_type="latent" parameter

In this way you are right, the process of converting the latents to image can be skipped.

How much VRAM is needed if we move the pipe to cuda instead of enable_model_cpu_offload?

With 4 images, you can use 24G GPU Memory.

from stable-diffusion-xl-demo.

lifeisboringsoprogramming avatar lifeisboringsoprogramming commented on June 8, 2024

I have 12G VRAM and cannot even do one image using pipe to cuda, thank you so much.

from stable-diffusion-xl-demo.

TonyLianLong avatar TonyLianLong commented on June 8, 2024

Two updates:

  1. If the intermediate images are not needed (i.e., we don't want to compare before/after), no decoding and re-encoding between the base generation and refinement stage are used.
  2. Offloading can be controlled with environment variables.

from stable-diffusion-xl-demo.

lifeisboringsoprogramming avatar lifeisboringsoprogramming commented on June 8, 2024

refiner-latent-vs

I got some results
on the left: using images as refiner input
on the right: using latent as refiner input

the head of the middle guy has some differences.

Thanks

from stable-diffusion-xl-demo.

TonyLianLong avatar TonyLianLong commented on June 8, 2024

Thanks for this example. Is using images consistently better than using latents?

from stable-diffusion-xl-demo.

lifeisboringsoprogramming avatar lifeisboringsoprogramming commented on June 8, 2024

I did not do any more testing for that
I think I decided to do the refiner only after knowing how this picture looked is a better workflow

from stable-diffusion-xl-demo.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.