Skip to content

feat: Add Ideogram4 model support (CORE-208) - #14259

Merged
comfyanonymous merged 1 commit into
Comfy-Org:masterfrom
kijai:ideogram4
Jun 3, 2026
Merged

feat: Add Ideogram4 model support (CORE-208)#14259
comfyanonymous merged 1 commit into
Comfy-Org:masterfrom
kijai:ideogram4

Conversation

@kijai

@kijai kijai commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Ideogram 4 support

Adds support for the Ideogram 4 text-to-image model, plus a few generic sampling/conditioning nodes to use it's separate uncondtional model.

Model

  • comfy/ldm/ideogram4/model.py — NextDiT/Lumina2-family single-stream DiT. Packs [text, image] into one sequence with block-diagonal segment attention and 3D interleaved MRoPE; runs image-only when no context is given.
  • Text encoder: Qwen3-VL-8B with a 13-layer hidden-state tap (53248-dim conditioning).

Nodes (comfy_extras/nodes_ideogram4.py)

  • Ideogram4Scheduler — logit-normal sigma schedule.

Generic additions

  • DualModelGuider — runs the conditional pass on one model and the unconditional pass on a separate model.
  • CFGOverride — override cfg to a fixed value over a [start, end] step range.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces complete Ideogram 4 model support to ComfyUI. The core implementation adds a single-stream transformer backbone with AdaLN-modulated attention blocks, QKV projections, and RoPE positional encoding. A Qwen3-VL 8B text encoder taps 13 hidden-state layers to produce per-token LLM features injected into text token positions. The model integrates with ComfyUI via detection from state dict keys, registration in supported models, and CLIP type routing. Sampling extensions include a logit-normal sigma scheduler tuned to Ideogram 4's diffusion process and dual-model guidance for separate conditional and unconditional prediction passes. Advanced sampler nodes for CFG override and dynamic guidance scaling complete the feature set.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.57% 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 accurately summarizes the main change: adding Ideogram4 model support. It is concise, clear, and directly reflects the primary objective of this changeset.
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.
Description check ✅ Passed The PR description clearly relates to the changeset, detailing Ideogram 4 model support with specific components including the transformer backbone, text encoder, and new sampling nodes.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@comfy/ldm/ideogram4/model.py`:
- Line 40: The forward (and any _backbone) signature uses a mutable default
transformer_options={}, which can leak state; change the signature to use
transformer_options=None and inside forward (and _backbone if present) set
transformer_options = {} if None, then use/mutate that local dict. Update
references in comfy/ldm/ideogram4/model.py around the forward method and any
_backbone helper to stop relying on a shared default dict.

In `@comfy/text_encoders/ideogram4.py`:
- Around line 61-65: The flatten currently uses out.permute(0, 2, 3,
1).reshape(b, seq, h * n) which produces hidden-major ordering; to concatenate
each full 4096-dim tap vector in tap-major order change the permutation so taps
are adjacent before the reshape. In encode_token_weights, after getting out,
permute to (0, 2, 1, 3) to produce shape (B, seq, n, h) and then reshape to (b,
seq, n * h) so each tap's full 4096 vector is concatenated in sequence (keep
variables out, b, n, seq, h and returned pooled, extra as before).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b6a62744-ae09-4ed5-8de0-ac0c2f54c6f1

📥 Commits

Reviewing files that changed from the base of the PR and between bd7da05 and 8335a17.

📒 Files selected for processing (9)
  • comfy/ldm/ideogram4/model.py
  • comfy/model_base.py
  • comfy/model_detection.py
  • comfy/sd.py
  • comfy/supported_models.py
  • comfy/text_encoders/ideogram4.py
  • comfy_extras/nodes_custom_sampler.py
  • comfy_extras/nodes_ideogram4.py
  • nodes.py

Comment thread comfy/ldm/ideogram4/model.py
Comment thread comfy/text_encoders/ideogram4.py
@yamatazen

Copy link
Copy Markdown

Isn't that a closed model?

@comfyanonymous
comfyanonymous merged commit 24f9a02 into Comfy-Org:master Jun 3, 2026
14 checks passed
@MeiYi-dev

Copy link
Copy Markdown

Isn't that a closed model?

Not the latest version. They have it as open weight now.

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.

4 participants