Skip to content

Add Ideogram 4 Scheduler node with preconfigured presets.#14399

Open
silveroxides wants to merge 3 commits into
Comfy-Org:masterfrom
silveroxides:feature/ig4-presetscheduler
Open

Add Ideogram 4 Scheduler node with preconfigured presets.#14399
silveroxides wants to merge 3 commits into
Comfy-Org:masterfrom
silveroxides:feature/ig4-presetscheduler

Conversation

@silveroxides

@silveroxides silveroxides commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Would reduce UI bloat significantly in both template and for easy and quick deployment.

MUVysQpepW

EDIT: I also added two additional presets that close the cap between default and quality presets and provide a middleground between turbo and default on the lower end.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5444498b-8e25-4830-8493-b0c644f37c3d

📥 Commits

Reviewing files that changed from the base of the PR and between 3b87c2c and 0a63e54.

📒 Files selected for processing (1)
  • comfy_extras/nodes_ideogram4.py
📜 Recent review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: test (windows-2022)
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test (windows-latest)
  • GitHub Check: test (macos-latest)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Keep imports at module scope; avoid inline imports unless they are already part of an established optional-backend probe or are needed to avoid an import cycle.
Do not add unnecessary try/except blocks; use them only for optional dependency, platform, or backend capability detection when the program has a useful fallback, and prefer specific exception types when changing new code.
Remove workarounds for PyTorch versions that ComfyUI no longer officially supports; if a workaround does not have a comment naming the exact supported PyTorch version(s), remove it.
Let unsupported model formats, invalid quantization metadata, and bad states fail with clear errors instead of silently producing lower quality output.
Match the existing local style in the file you edit; this codebase tolerates long lines, simple helper functions, module-level state, and direct tensor operations when they make the code easier to follow.
Keep comments sparse and useful; strip useless comments that restate the code or describe obvious behavior, while allowing short TODOs that name the concrete missing follow-up.
Treat dtype, device placement, VRAM usage, and offloading behavior as core correctness concerns; check CPU, CUDA, ROCm, MPS, DirectML, XPU, NPU, and low VRAM implications when touching shared execution or loading code.
Prefer native ComfyUI formats and existing quantization/offload helpers over adding parallel code paths; use comfy.quant_ops, comfy.model_management, comfy.memory_management, comfy.pinned_memory, comfy_aimdo, and comfy-kitchen helpers where they already solve the problem.
Use optimized comfy-kitchen ops where they improve performance without changing expected dtype, device, memory, or interface behavior.
All models should use the optimized attention function selected by ComfyUI; higher-level code must not inspect function identity, names, modules, or implementation details to decide behavior.
Apply the same opacity rule to similar patterns beyond...

Files:

  • comfy_extras/nodes_ideogram4.py
**

⚙️ CodeRabbit configuration file

**: ## Engineering Style

  • Keep changes small and direct. Most fixes should touch the narrowest code path
    that explains the bug, performance issue, dtype issue, model-format issue, or
    user-facing behavior.
  • Change the least amount of files possible. A change that touches many files is
    more likely to be a bad change than a good one unless the broader scope is
    directly required.
  • Prefer practical fixes over broad architecture work. Add abstractions only
    when they remove real repeated logic or match an existing ComfyUI pattern.
  • Prefer fewer dependencies. Do not add new dependencies to ComfyUI unless they
    are absolutely necessary.
  • Delete obsolete code aggressively when newer infrastructure makes it useless.
    Remove dead fallbacks, migration paths, unused options, debug prints, and
    compatibility branches that are no longer needed. Do not leave dead branches,
    unreachable code, or functions that are never called. If code is not
    necessary for the current behavior, remove it.
  • Revert or disable problematic behavior quickly when it breaks users. It is
    better to remove a broken feature path than keep a complicated partial fix.
  • Preserve existing APIs, node names, model-loading behavior, file layout, and
    workflow compatibility unless the change is explicitly about replacing them.
  • Code must look hand-written for this repository. Changes that read like
    generic AI-generated code will be rejected automatically: unnecessary helper
    layers, vague names, boilerplate comments, defensive branches without a real
    failure mode, broad rewrites, or code that ignores the local style.

Architecture Boundaries

  • Keep each layer focused on the concepts it owns. Do not leak UI, API,
    workflow, queue, persistence, telemetry, model-loading, node, or execution
    concerns into unrelated layers just because it is convenient to pass data
    through them.
  • Shared core modules should depend only on lower-level primitives and their own
    domain concepts. Highe...

Files:

  • comfy_extras/nodes_ideogram4.py

⚙️ CodeRabbit configuration file

**: IMPORTANT: Only comment on issues directly introduced by this PR's code changes.
Treat AGENTS.md as mandatory repository policy, not optional style guidance.
Flag PR changes that violate AGENTS.md even when the code is otherwise functional.
In particular, enforce architecture boundaries, dtype/device/memory rules,
interface contracts, import style, no unnecessary try/except blocks, no inline
imports, no outbound internet paths in core ComfyUI, and narrow scoped fixes.
Prefer direct findings over suggestions when a rule is violated. Only ignore
AGENTS.md when it clearly conflicts with a newer explicit maintainer instruction
in the PR.
Do NOT flag pre-existing issues in code that was merely moved, re-indented,
de-indented, or reformatted without logic changes. If code appears in the diff
only due to whitespace or structural reformatting (e.g., removing a with: block),
treat it as unchanged. Contributors should not feel obligated to address
pre-existing issues outside the scope of their contribution.

Files:

  • comfy_extras/nodes_ideogram4.py
comfy_extras/**

⚙️ CodeRabbit configuration file

comfy_extras/**: Community-contributed extra nodes. Focus on:

  • Consistency with node patterns (INPUT_TYPES, RETURN_TYPES, FUNCTION, CATEGORY)
  • No breaking changes to existing node interfaces

Files:

  • comfy_extras/nodes_ideogram4.py
🧠 Learnings (5)
📚 Learning: 2026-02-21T14:01:41.482Z
Learnt from: pythongosssss
Repo: Comfy-Org/ComfyUI PR: 12555
File: comfy_extras/nodes_glsl.py:719-724
Timestamp: 2026-02-21T14:01:41.482Z
Learning: In PyOpenGL, bare Python scalars can be accepted for 1-element array parameters by NumberHandler. This means you can pass an int/float directly to OpenGL texture deletion (e.g., glDeleteTextures(tex)) without wrapping in a list. Verify function-specific expectations and ensure types match what the OpenGL call expects; use explicit lists only when the API requires an array.

Applied to files:

  • comfy_extras/nodes_ideogram4.py
📚 Learning: 2026-03-04T14:05:31.426Z
Learnt from: jtydhr88
Repo: Comfy-Org/ComfyUI PR: 12757
File: comfy_extras/nodes_custom_sampler.py:1069-1089
Timestamp: 2026-03-04T14:05:31.426Z
Learning: In the ComfyUI sampling pipeline, treat percent_to_sigma(0.0) as a sentinel value (999999999.9) that means starting from pure noise. This is consistent with BasicScheduler via calculate_sigmas. The SamplingPercentToSigma node’s return_actual_sigma flag differentiates this sentinel from sigma_max. Reviewers should not flag CurveToSigmas or similar nodes that rely on percent_to_sigma as bugs; downstream samplers are expected to handle the sentinel correctly. When reviewing related sampling-related code, assume this sentinel semantics unless there is explicit handling for a real sigma_max.

Applied to files:

  • comfy_extras/nodes_ideogram4.py
📚 Learning: 2026-04-04T13:29:15.653Z
Learnt from: kijai
Repo: Comfy-Org/ComfyUI PR: 13258
File: comfy_extras/nodes_frame_interpolation.py:151-189
Timestamp: 2026-04-04T13:29:15.653Z
Learning: In this ComfyUI codebase, node `execute()` inference is already run under a global `torch.inference_mode()` context established in the execution engine (e.g., `execution.py` around line ~732). During review, avoid recommending changes that wrap node inference loops in `torch.inference_mode()`—it is already applied, so such suggestions are likely redundant.

Applied to files:

  • comfy_extras/nodes_ideogram4.py
📚 Learning: 2026-05-09T18:40:40.199Z
Learnt from: kijai
Repo: Comfy-Org/ComfyUI PR: 13813
File: comfy_extras/nodes_wandancer.py:868-872
Timestamp: 2026-05-09T18:40:40.199Z
Learning: When building video/temporal decoding nodes that call ComfyUI’s VAE.decode (comfy/sd.py), leverage VAE.decode’s existing VRAM-aware chunking along dim 0. Reshape or transpose the latent so the temporal dimension T is folded into dim 0 (e.g., transform a latent of shape [B, T, C, H, W] into [B*T, C, H, W] before calling vae.decode). This lets VAE.decode do chunked decoding without needing an explicit per-frame loop inside the node itself.

Applied to files:

  • comfy_extras/nodes_ideogram4.py
📚 Learning: 2026-05-20T00:10:14.673Z
Learnt from: Pauan
Repo: Comfy-Org/ComfyUI PR: 13997
File: comfy_extras/nodes_string.py:12-25
Timestamp: 2026-05-20T00:10:14.673Z
Learning: In the ComfyUI `comfy_extras/` codebase, some nodes intentionally ship with a default input string that references parameters that may not yet be connected. If the default would raise a `KeyError` (e.g., examples like `MathExpression` default `a + b`, or `StringFormat` default `{a}` with `min=0` and autogrow inputs), treat it as an intentional “hint default” UX pattern, not a bug. During review, do not flag this behavior or recommend changing `min` to `1` or altering the default to an empty string solely to avoid the `KeyError`.

Applied to files:

  • comfy_extras/nodes_ideogram4.py
🔇 Additional comments (2)
comfy_extras/nodes_ideogram4.py (2)

130-131: 📐 Maintainability & Code Quality

Ideogram4SchedulerPreset fits the existing node contract.


81-81: 🎯 Functional Correctness

Category moves don’t affect workflows. The node id stays the same, so this UI placement change is fine.

			> Likely an incorrect or invalid review comment.

📝 Walkthrough

Walkthrough

This PR adds an Ideogram 4 preset system: it imports enum, defines Ideogram4Enum with five presets (QUALITY, HIGH, DEFAULT, FAST, TURBO) and IDEOGRAM4_PRESET_CONFIGS mapping each preset to scheduler parameters (num_steps, mu, std, preset_id). It adds Ideogram4SchedulerPreset with a preset combo plus width/height, validates the preset, extracts steps/mu/std, delegates execution to Ideogram4Scheduler, and updates the extension to register both scheduler nodes.

🚥 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 accurately summarizes the new Ideogram 4 scheduler node and its preset-based configuration.
Description check ✅ Passed The description is directly related to the preset UI simplification and added preset options in this PR.
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.

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.

@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.

🧹 Nitpick comments (1)
comfy_extras/nodes_ideogram4.py (1)

19-37: ⚡ Quick win

Use enum-backed keys in IDEOGRAM4_PRESET_CONFIGS to prevent preset drift.

The preset identity is duplicated as free-form strings in both Ideogram4Enum and IDEOGRAM4_PRESET_CONFIGS. A future rename/addition can desync dropdown options from config keys and fail at runtime in execute. Key the config from enum values/constants directly.

Suggested change
 IDEOGRAM4_PRESET_CONFIGS = {
-  "Quality": {
+  Ideogram4Enum.QUALITY.value: {
     "num_steps": 48,
     "mu": 0.0,
     "std": 1.5,
     "preset_id": "V4_QUALITY_48"
   },
-  "Default": {
+  Ideogram4Enum.DEFAULT.value: {
     "num_steps": 20,
     "mu": 0.0,
     "std": 1.75,
     "preset_id": "V4_DEFAULT_20"
   },
-  "Turbo": {
+  Ideogram4Enum.TURBO.value: {
     "num_steps": 12,
     "mu": 0.5,
     "std": 1.75,
     "preset_id": "V4_TURBO_12"
   }
 }

As per coding guidelines, community nodes should keep interfaces/patterns consistent to avoid breaking behavior drift.

Also applies to: 91-102

🤖 Prompt for 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.

In `@comfy_extras/nodes_ideogram4.py` around lines 19 - 37, The preset map
IDEOGRAM4_PRESET_CONFIGS is keyed by free-form strings which duplicates
identifiers in Ideogram4Enum and can drift; change the keys to use the
enum-backed constants (use Ideogram4Enum.<NAME>.value or the enum member itself
depending on enum definition) so the map keys come directly from Ideogram4Enum,
update the other identical map at the other block (lines referenced around
91-102) the same way, and ensure anywhere the map is accessed (e.g., in execute)
looks up by the enum value/member rather than a hard-coded string.

Source: Coding guidelines

🤖 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.

Nitpick comments:
In `@comfy_extras/nodes_ideogram4.py`:
- Around line 19-37: The preset map IDEOGRAM4_PRESET_CONFIGS is keyed by
free-form strings which duplicates identifiers in Ideogram4Enum and can drift;
change the keys to use the enum-backed constants (use Ideogram4Enum.<NAME>.value
or the enum member itself depending on enum definition) so the map keys come
directly from Ideogram4Enum, update the other identical map at the other block
(lines referenced around 91-102) the same way, and ensure anywhere the map is
accessed (e.g., in execute) looks up by the enum value/member rather than a
hard-coded string.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 367494fa-85ac-4673-8d62-a9bb6047e6d9

📥 Commits

Reviewing files that changed from the base of the PR and between 6d18f4a and 4459602.

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

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