Skip to content

Fix fp16 intermediates giving different results.#13100

Merged
comfyanonymous merged 1 commit intomasterfrom
comfyanonymous-patch-1
Mar 21, 2026
Merged

Fix fp16 intermediates giving different results.#13100
comfyanonymous merged 1 commit intomasterfrom
comfyanonymous-patch-1

Conversation

@comfyanonymous
Copy link
Copy Markdown
Member

No description provided.

@comfyanonymous comfyanonymous merged commit 11c15d8 into master Mar 21, 2026
15 of 16 checks passed
@comfyanonymous comfyanonymous deleted the comfyanonymous-patch-1 branch March 21, 2026 21:53
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 21, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The prepare_noise_inner function in comfy/sample.py has been modified to standardize noise generation. The function now always creates random noise initially on the CPU using torch.float32 precision, then converts the resulting tensor(s) to match the latent_image.dtype. This unified approach applies regardless of whether noise_inds is None (generating a single noise tensor) or provided (generating per-index noise tensors before concatenation).

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess relevance to the changeset. Add a description explaining what issue is being fixed and why the change to always generate noise on CPU with float32 resolves the fp16 problem.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title directly references the specific issue being fixed: fp16 intermediates giving different results, which aligns with the code change that ensures consistent noise generation by using float32 initially.

✏️ 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.

Tip

CodeRabbit can use your project's `ruff` configuration to improve the quality of Python code reviews.

Add a Ruff configuration file to your project to customize how CodeRabbit runs ruff.

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