was-node-suite-comfyui icon indicating copy to clipboard operation
was-node-suite-comfyui copied to clipboard

Slow Image Save speed

Open brandostrong opened this issue 1 year ago • 17 comments

I have a large batch workflow and the WAS image save node is nearly the biggest bottleneck, it's almost slower than my detailer pass. Takes about 15 minutes to save 900 images, at 1-2 seconds per image. Has anyone experienced similar, it seems the rate decreases with the number of images as well. Has anyone experienced this as well? Is this a result of how comfy works or could there be batching or something implemented?

brandostrong avatar Nov 07 '23 21:11 brandostrong

Do you have history showing? If so it is processing the images saved plus images from history list (and sorting out dead ones if any). All those images are delivered via routes.

WASasquatch avatar Nov 08 '23 01:11 WASasquatch

I was hoping that'd be the case, but no, history is false, previews false. I am about 50% vram during use, about same for cpu memory, and in highvram mode, no difference without.

brandostrong avatar Nov 08 '23 04:11 brandostrong

same here but only for large resolution images. when i save 2048x2048, to be more exact

saruzaru avatar Nov 24 '23 16:11 saruzaru

i'm using comfyui to generate animations with animatediff, if that helps

saruzaru avatar Nov 24 '23 16:11 saruzaru

What happens if you disable sorting by prefix (even though preview is off)?

WASasquatch avatar Nov 24 '23 18:11 WASasquatch

everything is set to false extension is png and quality is set to 95 NVIDIA_Share_g0Jp9CZjVe

saruzaru avatar Nov 25 '23 20:11 saruzaru

I can confirm, everything false still sees extremely slow save speed. My assumption was the filename prefix loop or the repeated regex. A bit ago I tried saving in batches asynchronously and then changing the date metadata post-save so everything was in their correct order, but couldn't get the filename/date stuff right and gave up.

It did, however, speed up saving tremendously.

brandostrong avatar Nov 26 '23 06:11 brandostrong

Also have slow save speeds. 3 times slower than the standard save image.

Echolink50 avatar Nov 28 '23 18:11 Echolink50

Well it does have 10x the features and computation then standard image save.

On Tue, Nov 28, 2023, 10:03 AM Echolink50 @.***> wrote:

Also have slow save speeds. 3 times slower than the standard save image.

— Reply to this email directly, view it on GitHub https://github.com/WASasquatch/was-node-suite-comfyui/issues/265#issuecomment-1830404051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIZEZLYENLLYIPTRX5BMNDYGYRQXAVCNFSM6AAAAAA7B3E6GGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZQGQYDIMBVGE . You are receiving this because you commented.Message ID: @.***>

WASasquatch avatar Dec 05 '23 17:12 WASasquatch

This must be some problem with the png encoder. Other formats like jpg and webp work fine, but png takes literal minutes.

Simn avatar Dec 09 '23 07:12 Simn

That's strange since that code is just same code in normal original save image, copied over.

On Fri, Dec 8, 2023, 11:04 PM Simon Krajewski @.***> wrote:

This must be some problem with the png encoder. Other formats like jpg and webp work fine, but png takes literal minutes.

— Reply to this email directly, view it on GitHub https://github.com/WASasquatch/was-node-suite-comfyui/issues/265#issuecomment-1848273373, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIZEZONNTBIUOGZDMPPK2DYIQEP5AVCNFSM6AAAAAA7B3E6GGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBYGI3TGMZXGM . You are receiving this because you commented.Message ID: @.***>

WASasquatch avatar Dec 09 '23 18:12 WASasquatch

It comes from optimize=True in the img.save call. The original node doesn't have that, and apparently for a good reason.

Simn avatar Dec 10 '23 13:12 Simn

It comes from optimize=True in the img.save call. The original node doesn't have that, and apparently for a good reason.

How can we remove this? Is there a config file somewhere? Thanks

Echolink50 avatar Dec 10 '23 14:12 Echolink50

has this been fixed, should i try the node again?

saruzaru avatar Jan 06 '24 12:01 saruzaru

Soneone can make a PR to remove optimization or make it a Boolean, but I am really busy these days.

On Sat, Jan 6, 2024, 4:01 AM Damian Zaru @.***> wrote:

has this been fixed, should i try the node again?

— Reply to this email directly, view it on GitHub https://github.com/WASasquatch/was-node-suite-comfyui/issues/265#issuecomment-1879657389, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIZEZOKU5YWJ72CCWKPEADYNE4KXAVCNFSM6AAAAAA7B3E6GGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZZGY2TOMZYHE . You are receiving this because you commented.Message ID: @.***>

WASasquatch avatar Jan 09 '24 16:01 WASasquatch

I can confirm - dropping optimize=True makes it as fast as the original.

deepdelirious avatar Apr 02 '24 15:04 deepdelirious