ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Upscale Image (using Model) crashes before sending output

Open ricperry opened this issue 1 year ago • 7 comments

My batch image upscale is crashing just prior to sending the output to the next node. ComfyUI crashes without outputting any error messages. My usage situation follows:

140 frames 576 x 576 res 16bit pngs 4x_NMKD-Siax_200k.pth upscaler standalone workflow (no SD models loaded, just a plain pixel space upscaling workflow after a system reboot)

image

Terminal output:

got prompt [rgthree] Using rgthree's optimized recursive execution. [rgthree] First run patching recursive_output_delete_if_changed and recursive_will_execute. [rgthree] Note: If execution seems broken due to forward ComfyUI changes, you can disable the optimization from rgthree settings in ComfyUI. got prompt got prompt got prompt ./comfy.sh: line 5: 8152 Killed python main.py --auto-launch --listen --fp32-vae

ricperry avatar Apr 10 '24 21:04 ricperry

Getting the same problem, any luck solving it?

WilliamStanford avatar Apr 11 '24 15:04 WilliamStanford

Monitor to see if it's not a lack of memory.

ltdrdata avatar Apr 11 '24 15:04 ltdrdata

Monitor to see if it's not a lack of memory.

That's what I figured it would be, only happens when trying to upscale many frames at once. Any tips on how to get around this?

I was thinking I could try split the images into batches and then recombine them, but I'm not quite sure how to do that using ComfyUI.

WilliamStanford avatar Apr 11 '24 16:04 WilliamStanford

Yes, it exceeded my system ram + swap, then the process just quits. My VRAM was only at ~60%. I guess I'll have to expand the size of my swap file. [update] That didn't fix it. There's a runaway memory spike at the end of the node. It consumed 8G swap space in a matter of seconds and quickly exceeded my 40G RAM (32G memory + 8G swap). Earlier I had been using only 2G swap, and it didn't ramp up on memory usage so quickly.

ricperry avatar Apr 11 '24 16:04 ricperry

In such cases, I recommend using a node that fetches images sequentially one by one from the folder, rather than fetching all at once, and processing them separately with an auto queue. From what I remember, there is such a node in the WAS node.

FYI, That issue is unrelated to VRAM. When the system RAM reaches a critical state, it is the OS that forces the shutdown.

ltdrdata avatar Apr 12 '24 01:04 ltdrdata

I'm having the exact same issue but with video upscaling ksampler. Did anyone solve this problem?

AgeOfAlgorithms avatar May 20 '24 00:05 AgeOfAlgorithms

Seems to be an issue across all these upscale nodes, I have tried them all. Tried increasing swap, RAM, and still having the same issue. Big memory spike at last minute kills the server.

revolvedai avatar Aug 12 '24 23:08 revolvedai