Skip to content

Document non-Diffusers FP8/NVFP4 ComfyUI export#1991

Draft
jingyu-ml wants to merge 3 commits into
NVIDIA:mainfrom
jingyu-ml:agent/document-custom-nvfp4-comfyui-export
Draft

Document non-Diffusers FP8/NVFP4 ComfyUI export#1991
jingyu-ml wants to merge 3 commits into
NVIDIA:mainfrom
jingyu-ml:agent/document-custom-nvfp4-comfyui-export

Conversation

@jingyu-ml

@jingyu-ml jingyu-ml commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Add a short guide for a custom checkpoint owned by an arbitrary Python class with attached PyTorch modules.
  • Show how to collect selected components into a temporary nn.ModuleDict without creating a Hugging Face or Diffusers model.
  • Document the direct low-level packing path: inspect config, pack quantized leaves, hide quantizer state, adapt keys/config, and write one ComfyUI safetensors checkpoint.
  • Cover both FP8_DEFAULT_CFG and NVFP4_DEFAULT_CFG, including the NVFP4-only padding, scale swizzling, and second scale.
  • Link the guide from the Diffusers example README.

Why

The existing example constructs a Diffusers pipeline and uses the unified Hugging Face exporter. Custom torch-based applications may instead use a regular Python owner with several attached nn.Module components and custom checkpoint naming. They need a pipeline-independent route to ModelOpt's low-level packing APIs plus an explicit loader-specific ComfyUI adapter.

Impact

Documentation only; no runtime behavior changes.

Validation

  • pre-commit run --files examples/diffusers/quantization/CUSTOM-TORCH-TO-COMFYUI.md examples/diffusers/README.md
  • Both embedded Python snippets parsed successfully with ast.parse.
  • Referenced private API definitions and signatures checked against the current source.

Signed-off-by: Jingyu Xin <jingyux@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6951f808-66f5-44b3-bb4d-60c69f86e106

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Signed-off-by: Jingyu Xin <jingyux@nvidia.com>
@jingyu-ml jingyu-ml changed the title Document custom PyTorch NVFP4 ComfyUI export Document custom PyTorch FP8/NVFP4 ComfyUI export Jul 17, 2026
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.31%. Comparing base (d69d5aa) to head (18a3e58).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1991      +/-   ##
==========================================
- Coverage   73.83%   70.31%   -3.52%     
==========================================
  Files         519      525       +6     
  Lines       57960    64384    +6424     
==========================================
+ Hits        42795    45272    +2477     
- Misses      15165    19112    +3947     
Flag Coverage Δ
unit 54.79% <ø> (-0.45%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Jingyu Xin <jingyux@nvidia.com>
@jingyu-ml jingyu-ml changed the title Document custom PyTorch FP8/NVFP4 ComfyUI export Document non-Diffusers FP8/NVFP4 ComfyUI export Jul 17, 2026
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.

1 participant