Skip to content

Fix issues with loading half float files with pyav. - #16949

Merged
comfyanonymous merged 2 commits into
masterfrom
hf_float_load_fix
Oct 10, 2026
Merged

comfyanonymous merged 2 commits into
masterfrom
hf_float_load_fix

Conversation

@comfyanonymous

Copy link
Copy Markdown
Member

No description provided.

@comfyanonymous comfyanonymous changed the title Hf float load fix Fix issues with loading half float files with pyav. Oct 10, 2026
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Comfy-Org/ComfyUI/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e01de3d7-7b14-4470-8006-b6ac92d272a4


📥 Commits

Reviewing files that changed from the base of the PR and between ad30981 and 8a694f4.



📒 Files selected for processing (3)
  • comfy_api/latest/_input_impl/video_types.py
  • comfy_extras/nodes_images.py
  • tests-unit/comfy_api_test/video_types_test.py


🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:



Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.



📜 Recent review details
⏰ Context from checks skipped due to timeout. (9)
  • GitHub Check: Run Pylint
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test (windows-latest)
  • GitHub Check: test (macos-latest)
  • GitHub Check: test (windows-2022)
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test (macos-latest)
  • GitHub Check: test
  • GitHub Check: Run Pylint


🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — configured

📓 Path-based instructions (3)
Community-contributed extra nodes.

⚙️ CodeRabbit configuration file

Files:

  • comfy_extras/nodes_images.py

IMPORTANT: Only comment on issues directly introduced by this PR's code changes.

⚙️ CodeRabbit configuration file

Files:

  • comfy_extras/nodes_images.py
  • tests-unit/comfy_api_test/video_types_test.py
  • comfy_api/latest/_input_impl/video_types.py

Source excerpt: Keep changes small and direct.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • comfy_extras/nodes_images.py
  • tests-unit/comfy_api_test/video_types_test.py
  • comfy_api/latest/_input_impl/video_types.py

🔀 Multi-repo context Comfy-Org/ComfyUI_frontend, Comfy-Org/comfy-kitchen

Linked repositories findings

ComfyUI_frontend

  • EXR uploads are explicitly accepted as image inputs (image/*,.exr), and browser tests upload an EXR through /upload/image expecting success and no load error. The backend’s float-preservation fix directly affects this existing path. [::Comfy-Org/ComfyUI_frontend::]
  • The HDR viewer uses Three.js EXRLoader with FloatType and handles half-float data, so preserved float EXR values are consumed by frontend display/readout code. [::Comfy-Org/ComfyUI_frontend::]
  • Frontend video integration references the stable /video_metadata route and LoadVideo; no changed API signature or route contract was found. [::Comfy-Org/ComfyUI_frontend::]
  • The CI container currently pins ComfyUI v0.30.0; updating that pin and its matching commit is required if frontend CI must exercise this Core fix. [::Comfy-Org/ComfyUI_frontend::]

comfy-kitchen

  • The repository’s video-related functionality is limited to optimized MiniMax-H3 video-VAE compute kernels (fp16_conv3d, fused normalization/padding, and linear operations). [::Comfy-Org/comfy-kitchen::]
  • No EXR/OpenEXR or pixel-plane decoding references were found, and its public APIs are unrelated to this PR’s file decoding and EXR encoding changes. No coordination with comfy-kitchen is indicated. [::Comfy-Org/comfy-kitchen::]



🔇 Additional comments (3)
comfy_extras/nodes_images.py (1)

1698-1698: LGTM!


comfy_api/latest/_input_impl/video_types.py (1)

535-550: LGTM!


tests-unit/comfy_api_test/video_types_test.py (1)

138-173: LGTM!





📝 Walkthrough
📝 Walkthrough

Walkthrough

EXR encoding now requests zip16 compression alongside its existing half- or full-float format. Video decoding reads supported floating-point pixel formats directly from frame planes into float32 arrays, including byte-order handling and grayscale-to-RGB expansion. Parameterized tests check pixel preservation across storage types, channel layouts, widths, and crop modes.



Priority: ⚪ Not assessed

Merge Risk: ⚪ Minimal · up to 8a694

This change adds zip16 compression to EXR output and decodes float video frames directly to float32 arrays. The supplied context shows no actionable merge-blocking risk, and regression tests cover the decoding behavior.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 8a694

The inspected changes preserve existing file-loading paths and permissions while correcting float-pixel preservation. No material security risk was identified in the affected flows.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A supplied media file can exercise the new branch when its decoded frames use a listed float format. The demonstrated exposure is the existing image/video loading flow and its downstream tensor consumers; the inspected change does not expand file-selection authority or add a service boundary.

Trust Boundaries and Controls

  • observed — The inspected loading nodes retain annotated-path resolution, and VideoFromFile retains its existing av.open wrapper. Bypassing float conversion occurs after decoding; no authentication, authorization, path-selection, or isolation control is removed by the compared hunks.

Resilience and Maintainability Implications

  • inferred — The temporary plane views are copied by NumPy stack before tensors are retained, avoiding dependence on decoded-plane lifetime. The changed branch introduces no shared-state commit or recovery transition, and the existing container context manager continues to close the input when decoding returns or raises.

Pre-merge checks | Passed 3 | Failed 1 | Inconclusive 1

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Inconclusive No pull request description was added, so the intent and scope are not documented beyond the title. Add a brief description that explains the floating-point video or EXR loading fix and the associated regression tests.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly summarizes the primary change: fixing PyAV loading for half-float files. It is concise and directly related to the implementation and regression tests.

  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@comfyanonymous
comfyanonymous merged commit 7f7fd91 into master Oct 10, 2026
17 checks passed
@comfyanonymous
comfyanonymous deleted the hf_float_load_fix branch October 10, 2026 21:31
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.

2 participants