Commit Graph
11 Commits
Author SHA1 Message Date
by-ae 0415f865bb fix: keep an unusable style value from failing the prompt
style["style"] raised when the value was not a dict, and a non-string
overview did the same on strip. A style object is unchanged. A bare
kind string still selects that style, with its description left blank.
Anything else omits the style block.
2026-10-31 07:52:49 +10:00
by-ae 26767e46ca fix: report import JSON that does not override the editor
A connected import that was not valid JSON was dropped with no console
line, so the prompt quietly stayed on the editor caption. Non-objects
are reported the same way. A JSON object is still the prompt, and the
console names a missing compositional_deconstruction, background, or
elements list, which Ideogram 4 requires. A leading byte-order mark is
ignored.
2026-10-30 07:29:24 +10:00
by-ae af897e23d7 fix: accept RGBA and grayscale images as the canvas background
Preview BG Update opened every frame as RGB. Pillow rejects that mode
for a four-channel image, a single-channel image, or a plain height-width
array, so the save stopped and the canvas never updated. Those frames are
converted to RGB first. Alpha is composited onto black, which is what the
editor draws the preview over.
2026-10-30 07:29:24 +10:00
by-ae bc763779fb fix: report background images that cannot be converted
A tensor that Pillow could not turn into an image raised out of the node
and failed the workflow. The documented console warning never ran.
2026-10-29 07:48:02 +10:00
by-ae cd9df07f38 fix: keep unusable region fields from failing the prompt
A boolean palette or a non-string description raised while building the
caption or the preview. Those values are dropped or turned into text.
Short hex colors use the expanded color in the preview.

Style tooltips said a blank descriptor is omitted. It is sent as an empty
string, which is what the caption schema requires for those keys.
2026-10-29 07:46:20 +10:00
2929e02252 fix: skip unusable region coordinates instead of failing the caption
A region stored with numeric strings, NaN, a boolean, or a huge finite
value raised from round() while building the Ideogram bbox or the preview,
so one bad box failed the whole node. Those coordinates are now omitted
from the caption and the preview, and numeric strings still convert.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: AE <by-ae@users.noreply.github.com>
2026-10-27 21:00:52 +00:00
a35ebb7d3f fix: keep color palettes inside the Ideogram 4 caption schema
The caption verifier accepts only uppercase #RRGGBB, at most 16 style
colors and 5 per element. Shorthand #RGB is expanded, other values are
dropped, and a null palette no longer crashes prompt assembly.

Co-authored-by: AE <by-ae@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-10-26 21:08:32 +00:00
6a050339f7 fix: normalize inverted and non-numeric Ideogram bboxes
Pasted captions with swapped or non-numeric bbox values produced negative
or NaN regions, so the editor could not select them. Coordinates are now
swapped and clamped to the 0-1000 range from the Ideogram 4 caption schema,
and unreadable bboxes keep the non-overlapping grid slot for that element.
Saved regions with NaN coordinates are dropped on restore.

Co-authored-by: AE <by-ae@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-10-26 21:07:29 +00:00
42bdd7eaf3 fix: report background image save failures in the console
Preview BG Update logged save and notify failures only when BG_DEBUG was
set, so the console stayed quiet while the README told users to look there.
Warnings now print for a missing image, an empty or invalid guid, a tensor
that cannot be converted, a disk write error, and a failed editor push.

Co-authored-by: AE <by-ae@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-10-26 21:05:18 +00:00
by-aeandCursor Agent 924e4908b4 fix: prevent region overlap when bbox is missing
When importing captions with missing/invalid bbox data, elements are now
arranged in a 4-column grid (row/column layout) instead of a diagonal
pattern that overlapped after 6 elements.

- Change fallback positioning from modulo-6 diagonal to row/column grid
- Update both Python backend and JavaScript editor
- Add comprehensive test for 12+ elements with no overlap
- Fixes visual collision when pasting captions with many unbounded regions

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-10-25 20:59:42 +00:00
by-aeandCursor Agent 223ec7e15b Add comprehensive test coverage for routes and nodes
Tests cover:
- routes.py: Input validation, path traversal protection, JSON
  error handling, GUID sanitization (12 new tests)
- nodes/ideogram4_nodes.py: Prompt assembly, bbox normalization,
  palette handling, JSON serialization, input coercion (28 new tests)

All tests use mocks via conftest.py to avoid ComfyUI dependencies.
Tests import the repo as a proper package so routes.py relative
imports work unchanged.

CI: Install aiohttp for route tests.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-10-23 21:16:56 +00:00