PRIS-CV / DemoFusion

Let us democratise high-resolution generation! (CVPR 2024)
https://ruoyidu.github.io/demofusion/demofusion.html
1.98k stars 229 forks source link

demo_lowvram.py fails due to image_lr being None #34

Closed Lobo75 closed 10 months ago

Lobo75 commented 10 months ago

Looks like from the comments image_lr in pipeline_demofustion_sdxl.py is optional but it's not properly handled when lowvram is set to true.

I'm not sure what a proper value would be for image_lr in pipeline_demofustion_sdxl.py when called from demo_lowvram.py but since it's optional the following change worked for me to allow the demo to run.

pipeline_demofusion_sdxl.py line 898:

    if self.lowvram:
        self.vae.cpu()
        self.unet.cpu()
        self.text_encoder.to(device)
        self.text_encoder_2.to(device)

        if (image_lr is not None):
          image_lr.cpu()
RuoyiDu commented 10 months ago

@Lobo75 Thanks for pointing this out! We will fix it.