WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.23k stars 178 forks source link

Slow Image Save speed #265

Open brandostrong opened 1 year ago

brandostrong commented 1 year ago

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?

WASasquatch commented 1 year ago

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.

brandostrong commented 1 year ago

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.

saruzaru commented 1 year ago

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

saruzaru commented 1 year ago

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

WASasquatch commented 1 year ago

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

saruzaru commented 1 year ago

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

brandostrong commented 1 year ago

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.

Echolink50 commented 1 year ago

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

WASasquatch commented 12 months ago

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: @.***>

Simn commented 11 months ago

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

WASasquatch commented 11 months ago

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: @.***>

Simn commented 11 months ago

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

Echolink50 commented 11 months ago

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

saruzaru commented 11 months ago

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

WASasquatch commented 10 months ago

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: @.***>

deepdelirious commented 8 months ago

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