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

corrected requirements_versions.txt adjustments (otherwise wouldn't work if using README.md parameters) #1

Closed
suphamster opened this issue Jan 11, 2025 · 3 comments

Comments

@suphamster
Copy link

accelerate==0.26.0
diffusers==0.32.0

P.S. Btw processing speed is very slow at NV RTX 4070 and about 1/4 of its power is used.

@DenOfEquity
Copy link
Owner

Thanks for correction.

You could try editing sampler_invsr.py in the huggingface_hub directory. Lines 115-116:

        sd_pipe.to("cuda")
#        sd_pipe.enable_model_cpu_offload()

This improves GPU utilization from ~50% average to ~95% on my 1070 but then requires >8GB VRAM for medium size or larger images, otherwise will spill into shared memory and be much slower. It'll need a full restart of Forge to take effect after making the change.
Currently investigating modifications to the pipe - seems like it encodes the prompt for every tile.

@DenOfEquity
Copy link
Owner

I've reworked the model handling: now only encodes the prompt once, VAE encodes all tiles, then inferences all tiles, then VAE decodes all tiles - so reduced VRAM usage + much less model moving on GPUs with low VRAM. (original HF Space implementation, for each tile: encode prompt > VAE encode > inference > VAE decode; with potential CLIP/VAE/unet moving before each stage).
Also uses Forge's model movement, which should be better than diffusers model offloading, although this might not make any real difference after the main changes.

@suphamster
Copy link
Author

suphamster commented Jan 12, 2025

Thanks, now it works much better/faster. Anyway I think this SR is a bit unpolished (not to get results as described here zsyOAOA/InvSR#5) and needs good quality input (if upscale real images for example as separate tool at spaces tab) and better faces handling but it's question to its developer and not you.

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