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

FP32 causes 8GB vram gpu out of memory error, RunDiffusion/Juggernaut-X-v10 FP16 is not supported #63

Open
xhoxye opened this issue Jun 3, 2024 · 11 comments

Comments

@xhoxye
Copy link

xhoxye commented Jun 3, 2024

# SDXL
sdxl_name = RunDiffusion/Juggernaut-X-v10 #FP16 is not supported
# sdxl_name = SG161222/RealVisXL_V4.0
# sdxl_name = stabilityai/stable-diffusion-xl-base-1.0

QQ截图20240604070222

FP32 can be downloaded, however it causes 8GB vram gpu out of memory error

@xhoxye xhoxye changed the title RunDiffusion/Juggernaut-X-v10 FP16 is not supported FP32 causes 8GB vram gpu out of memory error, RunDiffusion/Juggernaut-X-v10 FP16 is not supported Jun 3, 2024
@Duemellon
Copy link

I see the syntax you used to change models but I'm not sure how to apply that to my own. Of course all my models are located in the A1111 folder somewhere else. What is the syntax? Is there a problem concern with the file extension?

@xhoxye
Copy link
Author

xhoxye commented Jun 4, 2024

@Duemellon
It's not a .safetensors file name, it's the huggingface directory name
https://huggingface.co/SG161222/RealVisXL_V4.0

@Duemellon
Copy link

So you can't point this to a local download of a file at this time? It can only do a download after you point to the HF link?

@xhoxye
Copy link
Author

xhoxye commented Jun 5, 2024

If you want to load the local .safetensors file, you will need to modify more code

@Manul07
Copy link

Manul07 commented Jun 5, 2024

no undesend

@Duemellon
Copy link

Duemellon commented Jun 5, 2024

If you want to load the local .safetensors file, you will need to modify more code

yes, that's what would be needed. I have a terabyte or more of locally installed safetensor fiels that I could use instead of pointing to a a HF directory. I'm not familiar with PY at all to make these changes but that is a different topic than this thread at this point.

@xhoxye
Copy link
Author

xhoxye commented Jun 5, 2024

models_dir = os.path.join(os.getcwd(), 'models/checkpoints')

sdxl_name = 'RealVisXL_V4.0'

model_path = os.path.join(models_dir, sdxl_name + '.safetensors')

if os.path.isfile(model_path):
    temp_pipeline = StableDiffusionXLImg2ImgPipeline.from_single_file(model_path)
    
    tokenizer = temp_pipeline.tokenizer
    tokenizer_2 = temp_pipeline.tokenizer_2
    text_encoder = temp_pipeline.text_encoder
    text_encoder_2 = temp_pipeline.text_encoder_2
    text_encoder_2 = CLIPTextModel(config=text_encoder_2.config)
    vae = temp_pipeline.vae
    unet = temp_pipeline.unet
else:
    raise FileNotFoundError(f"Model file {model_path} not found.")  

@xhoxye
Copy link
Author

xhoxye commented Jun 6, 2024

QQ截图20240606095725
QQ截图20240606095718
QQ截图20240606095707
QQ截图20240606095646

QQ截图20240606095630

@xhoxye
Copy link
Author

xhoxye commented Jun 6, 2024

I'll submit a PR later

@xhoxye
Copy link
Author

xhoxye commented Jun 6, 2024

"torch_dtype=torch.float32" It run incorrectly

@xhoxye
Copy link
Author

xhoxye commented Jun 7, 2024

#81

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

3 participants