mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-07-13 04:16:58 +08:00
Merge 14700174a5ef2f1de7efead4a69b198126b251d8 into 9304e47351be8d178a093b30bcaf5d72c3a2baf5
This commit is contained in:
commit
222c866caa
@ -66,17 +66,17 @@ class ImageUpscaleWithModel(io.ComfyNode):
|
||||
def execute(cls, upscale_model, image) -> io.NodeOutput:
|
||||
device = model_management.get_torch_device()
|
||||
|
||||
tile = 512
|
||||
overlap = 32
|
||||
|
||||
memory_required = model_management.module_size(upscale_model.model)
|
||||
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 += (tile * tile * 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()
|
||||
model_management.free_memory(memory_required, device)
|
||||
|
||||
upscale_model.to(device)
|
||||
in_img = image.movedim(-1,-3).to(device)
|
||||
|
||||
tile = 512
|
||||
overlap = 32
|
||||
|
||||
oom = True
|
||||
while oom:
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user