ChrisandClaude Opus 4.8 9352b23986 fix(resolution selector): aspect-preserving clamp + read-only readout with max warning
- megapixel/auto now preserve the aspect ratio when clamped to the profile's per-side cap (16:9 at max -> 2048x1152, not 2048x2048); aspect is prioritized over hitting the exact target size.

- Replaced the Apply button with a read-only readout (resulting WxH + MP); edits and new connections auto-push the dims to a connected Prompt Builder canvas.

- Added a profile-aware warning shown when the request is clamped to the profile's maximum (e.g. Ideogram 4 max 2048x2048).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 21:43:29 +02:00

ComfyUI-AI2Go-Utils

ComfyUI-AI2Go-Utils

ComfyUI nodepack by AIKnowledge2Go

ℹ️ Published for reference. Issues are disabled and pull requests are closed automatically — this repo doesn't accept contributions, and no support is provided. You're welcome to fork and adapt it under the GPL-3.0 license.

Contact

Installation

Clone into your ComfyUI custom_nodes directory and restart ComfyUI:

cd ComfyUI/custom_nodes
git clone https://github.com/Little-God1983/ComfyUI-AI2Go-Utils

No extra dependencies (it uses Pillow, already shipped with ComfyUI). It can coexist with ComfyUI-KJNodes — both Ideogram 4 nodes run side by side without conflict.

Nodes

AI2Go Ideogram 4 Prompt Builder

A visual prompt builder for Ideogram 4's structured JSON caption format. Draw bounding-box regions on a canvas, describe each one, and the node assembles the caption — with a full scene-graph Overview, region parenting, and named groups layered on top.

Outputs: prompt (the caption JSON), preview (a rendered overlay image), bboxes (pixel-space boxes for SAM3 / crop nodes), width, height.

How it works

Region editor (canvas)

  • Draw by dragging; move and resize with handles; Ctrl-drag to force-draw over an existing box.
  • Per-region type (object / text), description, verbatim text, and a color palette; editable bbox fields (pixels + the 0–1000 grid).
  • Multi-select — shift-drag marquee, shift-click toggle; Alt-click cycles overlapping boxes; Del / Ctrl+C·V·D to remove / copy / paste / duplicate.
  • Lock regions, composition guides (thirds / grid / golden ratio / spiral), snap-to-grid, and adjustable label & box styling.
  • Background: a connected reference image, the last generated image ("Grab BG"), or the live sampling preview — with a brightness control.
  • Dockable / pinnable / fullscreen panel, a live token estimate, and output settings (compact/pretty JSON, normalized/absolute coords, yx/xy bbox order).

Overview (scene tree)

  • A persistent, collapsible panel listing every region — click a row to select it (synced both ways with the canvas), so you can pick and edit a region without nudging it.
  • Ctrl/Cmd-click to multi-select, Shift-click for a range.
  • Lock, duplicate, and delete from the list; drag a row — or a whole multi-selection — onto another to nest it; drop on the header to send back to root.

Parenting & groups

  • Parent any region under another: move a parent on the canvas and its children follow. Deleting a parent promotes its children to the grandparent (no surprise subtree wipe).
  • Groups — right-click the Overview → Create group from selection to wrap regions in a named container:
    • Move the group → everything moves; resize the group → its members scale.
    • Duplicate the whole group, or mirror its members horizontally / vertically.
    • Deleting a group keeps its children.
    • Groups are editor-only organizers — never part of the exported prompt. Toggle their frames on the canvas with 👁️ (hidden by default; always listed in the Overview).

Copy / paste & interop

  • Copy / Paste the caption JSON, and save/load named Templates (stored server-side). Each template can carry an optional preview image — click 📷 in the Templates menu to pick one (it's center-cropped to a 200×200 webp), or just drop a matching <template-name>.{webp,png,jpg,jpeg} next to the template file and it's picked up automatically.
  • Copies carry a small _ai2go sidecar that preserves the full layout (groups + hierarchy) for a lossless AI2Go → AI2Go round-trip, while staying two-way compatible with ComfyUI-KJNodes: KJNodes ignores the extra data and loads the flat scene, and KJNodes captions load here flat too. The sidecar never reaches the model prompt.

AI2Go Ideogram 4 Style Wizard

A "click-together" helper for the style fields of an Ideogram 4 caption — so you don't have to type aesthetics / lighting / medium / photo / art_style by hand.

  • Wire the wizard's style output into a Prompt Builder's import_json input (the link just tells the wizard which builder to fill).
  • Click 🪄 Open Style Wizard to open a two-tab modal. On the Pick styles tab, toggle one or many chips per category (they're comma-joined) or type your own; a search box filters chips, a live JSON preview shows the assembled style_description, and a status line names the builder you're writing to (or warns if nothing's connected).
  • Photo vs. art_style are both selectable; if you set both, a warning notes that only photo is applied (Ideogram allows only one).
  • Apply pushes the picks to the connected builder without closing (handy for tweaking); Apply & close (and Esc / clicking the backdrop) does the same and closes. Either way the picks are written straight into the builder's style widgets — your bounding boxes, color palette, and high_level_description are left untouched, and the node emits an empty string at run time so the import_json wire never overwrites the builder's regions.

Editable chip presets. The chip lists live in ComfyUI/user/default/ai2go/ideogram4/WizardStylesDefault.json. Edit them right in the wizard on the Edit presets tab — add, rename, or delete chips per category, then Save to file (or Discard / Restore defaults). You can also hand-edit the JSON (each entry's key must be one of aesthetics, lighting, medium, photo, art_style). If the file is missing or malformed, the wizard falls back to the built-in defaults and shows a warning (with the exact parse error) plus a Restore defaults button that (re)creates the file.

Credits & License

Licensed under GPL-3.0 — see LICENSE.

This pack is built on the Ideogram 4 Prompt Builder node and editor from ComfyUI-KJNodes by Kijai, which is licensed under GPL-3.0. Huge thanks to Kijai for the original work — the derived files retain their attribution, and per GPL-3.0 this pack is released under the same license.

S
Description
No description provided
Readme GPL-3.0
1.9 MiB
Languages
JavaScript 68.2%
Python 31.8%