Files
SurrealByDesign 79a8de97e1 Add IdeogramVisualPromptDesigner (Phase 1) and fix ensure_ascii bug across three nodes
IdeogramVisualPromptDesigner is the backend foundation for the planned
Visual Prompt Designer: builds a prompt from scratch or loads an existing
one, reconstructs an editable internal "designer state," restores
designer-only fields (subjects/hierarchy/relationships/notes/per-element
depth-weight-lock-hide-group) from a previously saved state, applies an
optional palette override, and re-validates with the existing
IdeogramJSONValidator. The drag/resize canvas, scene graph, and
relationship UI from the full spec need a custom ComfyUI frontend
extension and are a separate, future phase -- see README's new
"Ideogram Visual Prompt Designer" section for the status table,
architecture, round-trip workflow, and known limitations.

Found and fixed a real bug while building it: IdeogramJSONValidator,
IdeogramPromptAssembler, and IdeogramPaletteToGlobalJSON were all
missing ensure_ascii=False, silently escaping non-ASCII content into
\uXXXX sequences -- inconsistent with every other JSON-producing node
in this repo. IdeogramJSONValidator also gained two new outputs,
errors_json/warnings_json, added after the existing three so saved
workflows' connections by index are unaffected; updated the three
showcase workflows that reference it to match.

This went through a full pre-publish audit pass (category convention,
dead constants, a decorative non-functional id field removed, a no-op
reference_image input removed, validation structure) and was verified
end-to-end against a live ComfyUI server multiple times, including the
full round-trip workflow.

126 tests passing (up from 102).
2026-06-22 22:53:27 -04:00

55 lines
2.9 KiB
Python

"""ComfyUI-Ideogram-Palette-and-Prompt-Tools node registration."""
from .nodes.palette_extractor import IdeogramPaletteExtractor
from .nodes.palette_to_json import IdeogramPaletteToGlobalJSON
from .nodes.palette_override import IdeogramPaletteOverride
from .nodes.element_palette import IdeogramElementPalette
from .nodes.metadata_embedder import IdeogramMetadataEmbedder
from .nodes.palette_blend import IdeogramPaletteBlend
from .nodes.metadata_reader import IdeogramMetadataReader
from .nodes.json_validator import IdeogramJSONValidator
from .nodes.prompt_assembler import IdeogramPromptAssembler
from .nodes.metadata_file_reader import IdeogramLoadImageWithPrompt
from .nodes.masked_palette_extractor import IdeogramMaskedPaletteExtractor
from .nodes.vibrant_palette_extractor import IdeogramVibrantPaletteExtractor
from .nodes.element_builder import IdeogramElementBuilder, IdeogramElementCollector
from .nodes.visual_prompt_designer import IdeogramVisualPromptDesigner
NODE_CLASS_MAPPINGS = {
"IdeogramPaletteExtractor": IdeogramPaletteExtractor,
"IdeogramPaletteToGlobalJSON": IdeogramPaletteToGlobalJSON,
"IdeogramPaletteOverride": IdeogramPaletteOverride,
"IdeogramElementPalette": IdeogramElementPalette,
"IdeogramMetadataEmbedder": IdeogramMetadataEmbedder,
"IdeogramPaletteBlend": IdeogramPaletteBlend,
"IdeogramMetadataReader": IdeogramMetadataReader,
"IdeogramJSONValidator": IdeogramJSONValidator,
"IdeogramPromptAssembler": IdeogramPromptAssembler,
"IdeogramLoadImageWithPrompt": IdeogramLoadImageWithPrompt,
"IdeogramMaskedPaletteExtractor": IdeogramMaskedPaletteExtractor,
"IdeogramVibrantPaletteExtractor": IdeogramVibrantPaletteExtractor,
"IdeogramElementBuilder": IdeogramElementBuilder,
"IdeogramElementCollector": IdeogramElementCollector,
"IdeogramVisualPromptDesigner": IdeogramVisualPromptDesigner,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"IdeogramPaletteExtractor": "Ideogram Palette Extractor",
"IdeogramPaletteToGlobalJSON": "Ideogram Palette -> Global JSON",
"IdeogramPaletteOverride": "Ideogram Palette Override",
"IdeogramElementPalette": "Ideogram Element Palette",
"IdeogramMetadataEmbedder": "Ideogram Metadata Embedder",
"IdeogramPaletteBlend": "Ideogram Palette Blend",
"IdeogramMetadataReader": "Ideogram Metadata Reader",
"IdeogramJSONValidator": "Ideogram JSON Validator",
"IdeogramPromptAssembler": "Ideogram Prompt Assembler",
"IdeogramLoadImageWithPrompt": "Ideogram Load Image With Prompt",
"IdeogramMaskedPaletteExtractor": "Ideogram Masked Palette Extractor",
"IdeogramVibrantPaletteExtractor": "Ideogram Vibrant Palette Extractor",
"IdeogramElementBuilder": "Ideogram Element Builder",
"IdeogramElementCollector": "Ideogram Element Collector",
"IdeogramVisualPromptDesigner": "Ideogram Visual Prompt Designer",
}
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]