Skip to content

fix: change SaveAnimatedWEBP default method to 'fastest' for better performance#13334

Open
octo-patch wants to merge 1 commit intoComfy-Org:masterfrom
octo-patch:fix/issue-13300-saveanimatedwebp-default-method-fastest
Open

fix: change SaveAnimatedWEBP default method to 'fastest' for better performance#13334
octo-patch wants to merge 1 commit intoComfy-Org:masterfrom
octo-patch:fix/issue-13300-saveanimatedwebp-default-method-fastest

Conversation

@octo-patch
Copy link
Copy Markdown

Fixes #13300

Problem

The SaveAnimatedWEBP node defaults to method='default' which maps to WebP compression method=4. This causes very slow encoding times for animated WebP files with many frames — users reported 2.5+ minutes for 120-frame videos.

Community testing confirmed that switching to method='fastest' (method=0) reduces encoding time from ~31s to ~10s for typical use cases.

Solution

Change the default value for the method combo input from 'default' (method=4) to 'fastest' (method=0).

All options (default, fastest, slowest) remain available for users who need higher compression ratios. This only changes what is selected when a user first adds the node to their workflow.

Testing

  • Confirmed COMPRESS_METHODS = {"default": 4, "fastest": 0, "slowest": 6} mapping is unchanged
  • The default="fastest" parameter is correctly handled by IO.Combo.Input
  • Existing workflows with an explicit method selection are unaffected (saved workflow JSON preserves the chosen value)

…t' (fixes Comfy-Org#13300)

The 'default' compression method maps to WebP method=4, which is significantly
slower than method=0 ('fastest'). For animated WebP with many frames (e.g. 120
frames of video), this resulted in encoding times of 2+ minutes.

Changing the node default to 'fastest' (method=0) reduces encoding time by ~3x
while still allowing users to select higher compression methods when needed.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 515637fe-f419-4b59-95dc-e2d56cc1cfbb

📥 Commits

Reviewing files that changed from the base of the PR and between 2d861fb and f4d4dfa.

📒 Files selected for processing (1)
  • comfy_extras/nodes_images.py

📝 Walkthrough

Walkthrough

The pull request updates the SaveAnimatedWEBP class in comfy_extras/nodes_images.py. In the define_schema method, the method input field is modified to include a default value of "fastest" for the IO.Combo.Input parameter. The choices remain restricted to the available compression methods. No other schema or execution logic modifications are introduced.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: setting SaveAnimatedWEBP default method to 'fastest' for better performance, which matches the code change.
Description check ✅ Passed The description is directly related to the changeset, explaining the problem, solution, and testing for the default method change in SaveAnimatedWEBP.
Linked Issues check ✅ Passed The PR fully addresses the requirements from issue #13300 by changing the default compression method from 'default' (method=4) to 'fastest' (method=0), reducing encoding time from minutes to seconds.
Out of Scope Changes check ✅ Passed All changes are in-scope: only the default value for the 'method' parameter in SaveAnimatedWEBP's schema is modified; no unrelated code alterations are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SaveAnimatedWebP takes forever

1 participant