"...git@developer.sourcefind.cn:chenpangpang/diffusers.git" did not exist on "1dc231d14a48bd5ac48e53a5fa283e59da48673a"
Commit 16eabdf7 authored by comfyanonymous's avatar comfyanonymous
Browse files

Free more vram for upscale models.

parent 8dc19e40
...@@ -39,7 +39,7 @@ class ImageUpscaleWithModel: ...@@ -39,7 +39,7 @@ class ImageUpscaleWithModel:
device = model_management.get_torch_device() device = model_management.get_torch_device()
memory_required = model_management.module_size(upscale_model) memory_required = model_management.module_size(upscale_model)
memory_required += (512 * 512 * 3) * image.element_size() * max(upscale_model.scale, 1.0) * 256.0 #The 256.0 is an estimate of how much some of these models take, TODO: make it more accurate memory_required += (512 * 512 * 3) * image.element_size() * max(upscale_model.scale, 1.0) * 384.0 #The 384.0 is an estimate of how much some of these models take, TODO: make it more accurate
memory_required += image.nelement() * image.element_size() memory_required += image.nelement() * image.element_size()
model_management.free_memory(memory_required, device) model_management.free_memory(memory_required, device)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment