Add MJ image node, GIF save, and Kling/image generator updates
Ship o1key MJ图片生成 with content/style refs and prompt flags, save-GIF with preview, Kling 4.0 helpers, plus GPT/unified image node polish and docs.
This commit is contained in:
+18
-3
@@ -87,6 +87,19 @@ invalid model, duration, resolution, mode, media count, or edit clip length
|
||||
cannot consume an upload or paid generation request. Saved workflows retain the
|
||||
`O1keyGrokVideo` ID and are migrated according to [ADR 0006](decisions/0006-grok-video-api-and-workflow-migration.md).
|
||||
|
||||
`K3Video` keeps its released node ID and appends a `v4` DynamicCombo branch. The
|
||||
branch adds a generation-mode selector with text-to-video, keyframes, and Omni
|
||||
reference paths. Existing v3/v2.6/v3-omni branches retain their original
|
||||
DynamicCombo option order and positional widgets. Kling 4.0 keyframe sockets
|
||||
and additional Omni reference sockets are appended after the released widget
|
||||
block, so saved workflows do not shift their values. `clients/kling_video_client.py`
|
||||
owns the v4 capability checks and builds the proxy-compatible `model_name`,
|
||||
resolution `mode`, `aspect_ratio`, and `metadata` fields; the node reuses the
|
||||
existing R2 upload and interruption-aware task lifecycle. Keyframes use
|
||||
`metadata.first_frame`, `metadata.middle_frames`, and `metadata.last_frame`;
|
||||
Omni references use `metadata.refer_images` and `metadata.videos`. The shared
|
||||
video result parser also accepts Kling 4.0's `output.media[].url` envelope.
|
||||
|
||||
### Shared utilities
|
||||
|
||||
`utils/` contains cross-provider infrastructure:
|
||||
@@ -150,7 +163,7 @@ The generator's local `格式` input defaults to `原始` and is visible only fo
|
||||
|
||||
The panel displays model-route labels as `特价 / 优质 / 企业`, but serializes and submits the established internal values `畅速 / 直连 / 专线`. This label/value separation is mandatory: changing the serialized values would require a workflow migration and provider-matrix compatibility work.
|
||||
|
||||
The unified image generator retains its DOM panel, grouped sections, top batch controls, reference upload/canvas-picker header, empty add-reference tile, prompt-local AI writing action, inline seed randomizer, and bottom generate action. The released schema widgets remain hidden and provide the stable execution/serialization boundary. CSS presents generation/save parameters in one vertical list with left labels and right controls. Nodes 1.0 uses ComfyUI input theme tokens; inside the Nodes 2.0 widget host it uses component-node tokens. All buttons use the same neutral theme surface as the inputs. Switching renderers retains the same panel and values; it does not replace the panel with native schema widgets or append action rows.
|
||||
The unified image generator retains its DOM panel for the prompt, reference upload/canvas-picker header, empty add-reference tile, prompt-local AI writing action, inline seed randomizer, mask action, and bottom generate action. LiteGraph renders the released parameter widgets natively after that panel, so each parameter keeps the host's title/value frame and renderer-specific spacing; the native seed widget is replaced by one compact DOM row to keep its randomizer beside the value. Internal prompt and manifest widgets stay hidden. The schema widget order remains unchanged and `serializeGeneratorWidgets` writes only the ordered backend fields, keeping the DOM panel and hidden helpers out of saved `widgets_values`. Nodes 1.0 uses ComfyUI input theme tokens; inside the Nodes 2.0 widget host it uses component-node tokens. All buttons use the same neutral theme surface as the inputs. Switching renderers retains the same panel, native parameter values, and capability visibility without duplicating parameter controls or appending action rows.
|
||||
|
||||
LiteGraph includes UI widgets with `options.serialize:false` in workflow arrays, even though prompt serialization omits them. The generator serializes only its ordered backend widget values, excluding the hidden automatic seed control and the panel widget. Hidden automatic seed controls also set `widget.serialize = false` during panel creation and restoration: LiteGraph checks that widget-level flag when assigning saved values, so references, masks, batch settings, and save settings remain aligned after copy/paste or workflow loading. The seed randomizer remains inside its input row. Old hidden `control_after_generate` values after `seed` and the full-layout trailing empty panel value are removed by narrow idempotent migrations, including inside subgraphs. Node/input/output IDs and provider payloads stay unchanged. [ADR 0015](decisions/0015-image-generator-workflow-values.md) records this compatibility boundary.
|
||||
|
||||
@@ -164,7 +177,7 @@ New reference, source, target, and mask uploads use ComfyUI's native `/upload/im
|
||||
|
||||
Reference, source, and target thumbnails expose a bottom-right replacement action that uploads one local image through the existing non-overwriting queue and swaps only the original manifest entry after success. The original image and order survive validation or upload failure. The same thumbnails expose the browser-only image editor from their top-left action. `web/js/o1keyReferenceImageEditor.js` owns its modal, crop geometry, pointer drawing, single upper sticker layer, vector-arrow annotations, undo history, and PNG composition. Fixed aspect-ratio presets create the largest centred crop and allow repositioning; free mode also allows a new crop or corner resizing. The visual mask brush, coloured annotation brush, and arrows are flattened into the exported pixels and never become a ComfyUI `MASK` value. An arrow stores its exact source-coordinate start and end points; its tip is the pointer-release position, and its filled head scales with line width. A sticker is read from a temporary browser object URL, initially fitted and centred, and represented in source-image coordinates by centre, dimensions, rotation, and opacity. Its selection border, corner scale handles, and rotation handle are interaction chrome only. The source object URL is revoked when the editor closes and is never serialized or uploaded independently; only the flattened final pixels leave the modal. Sticker pixels are composed above the base image, then arrows and brush annotations are composed above the sticker so positional guidance stays visible. Applying an edit creates a non-overwriting PNG through the existing serialized `/upload/image` queue and atomically replaces that exact manifest entry; it does not overwrite the source file, add a workflow field, or change provider transport. If the entry is removed while the modal is open, the exported file is not attached to another position.
|
||||
|
||||
Optional source/target batching adds a pairing dimension without changing normal-mode task expansion. The panel calls the two roles `素材图` and `目标图`; these terms cover objects, elements, styles, materials, structures, or any other source content applied to a destination image. The legacy serialized value `一组搭配+多模特` treats all uploaded source references as one ordered group and appends exactly one target reference per pairing; because a provider request still accepts at most ten references, that mode allows nine source images plus one target image. The legacy value `全部搭配×全部模特` creates the source-major Cartesian product and sends exactly one source plus one target per task, allowing ten uploaded sources and ten uploaded targets to produce 100 pairings. The appended value `单图素材批量` creates one task per source image, sends that image as the sole provider reference, ignores the target manifest, and hides the target lane in the panel. This supports changing poses or expressions across several model images without an additional comparison reference. The complete order is prompt-major, then source/target pairing or source index, then copies for `每组生图数`; the 1000-task ceiling applies after all dimensions are expanded. Background jobs snapshot only the manifests used by the selected mode, retain reference indexes in the task plan, and resolve the exact references immediately before each paid request. Direct V3 execution uses the same task-plan helper. GPT masks are rejected while batch generation is enabled because a single edit mask cannot safely describe multiple changing reference sets.
|
||||
Optional source/target batching adds a pairing dimension without changing normal-mode task expansion. The panel calls the two roles `素材图` and `目标图`; these terms cover objects, elements, styles, materials, structures, or any other source content applied to a destination image. The value `整组素材→多个目标` treats all uploaded source references as one ordered group and appends exactly one target reference per pairing; because a provider request still accepts at most ten references, that mode allows nine source images plus one target image. The value `每张素材×每张目标` creates the source-major Cartesian product and sends exactly one source plus one target per task, allowing ten uploaded sources and ten uploaded targets to produce 100 pairings. The value `每张素材单独出图` creates one task per source image, sends that image as the sole provider reference, ignores the target manifest, and hides the target lane in the panel. This supports changing poses, expressions, colours, or type treatments across several source images without an additional comparison reference. The three labels are displayed verbatim, so they must stay industry-neutral; pre-rename labels are accepted through `IMAGE_BATCH_MODE_ALIASES` in Python and `BATCH_MODE_ALIASES` in the panel, and the loader rewrites them in `widgets_values`. The complete order is prompt-major, then source/target pairing or source index, then copies for `每组生图数`; the 1000-task ceiling applies after all dimensions are expanded. Background jobs snapshot only the manifests used by the selected mode, retain reference indexes in the task plan, and resolve the exact references immediately before each paid request. Direct V3 execution uses the same task-plan helper. GPT masks are rejected while batch generation is enabled because a single edit mask cannot safely describe multiple changing reference sets.
|
||||
|
||||
The panel exposes both manifest identity and provider-request position on every batch thumbnail. The group mode labels sources as request images `图1...图N` and every target as `图N+1` in its own request; Cartesian mode always labels the current source as `图1` and current target as `图2`; single-reference mode labels every source as `图1` because it is the sole reference in its request. Historical widget names and the first two batch-mode values remain unchanged for saved-workflow compatibility.
|
||||
|
||||
@@ -261,7 +274,9 @@ Completed videos are atomically promoted into the configured output location wit
|
||||
- Standard and panel-triggered unified image runs reuse a connected blank `O1keyImageSave` before creating another result node, and never overwrite populated sibling save nodes.
|
||||
- Unified GPT Image requests preserve the selected background and output format; transparent backgrounds are limited to PNG and WebP.
|
||||
- Unified GPT Image requests omit the retired moderation parameter.
|
||||
- `GPT Image 2.5 Sunburst` and `GPT Image 2.5 Flare` share GPT Image 2's resolution/aspect-ratio matrix and capability controls. Their `畅速 / 直连 / 专线` route values resolve to API IDs ending in `-sp / -sd /` no suffix, respectively.
|
||||
- `GPT Image 2.5 Sunburst / Flare` and `GPT Image 2.6 Sunburst / Flare` share GPT Image 2's resolution/aspect-ratio matrix and existing raster controls. Their `畅速 / 直连 / 专线` route values resolve to API IDs ending in `-sp / -sd /` no suffix, respectively; both newer series accept `xhigh / max` quality.
|
||||
- GPT Image 2.6 adds an append-only `复杂度` widget (unified index 23, after the existing layer-decomposition flag). The shared catalog validates `low / medium / high`, defaults to `high`, and omits the field for older models. Direct generation, standalone single/batch nodes, immutable background-job snapshots and client parallel fan-out carry the same selection. The control is hidden for other models without deleting its saved value. Existing node IDs, defaults and widget positions remain stable; older arrays use the appended widget's schema default. Standalone workflow migration temporarily removes a recognized complexity tail while existing tail-based rules run, then restores it; root and subgraph reloads remain idempotent.
|
||||
- GPT Image 2.6 adds SVG/GIF to the gated output-format menu (not the 2.0/2.5 raster list). SVG/GIF are generation-only and reject reference images/masks. GIF requests may send `frame_count` / `frame_duration_ms`; results expand to an IMAGE frame batch while original GIF bytes are preserved for playable preview/save. SVG writes a `.svg` file and returns a rasterized IMAGE preview (cairosvg/ImageMagick/Inkscape when available; otherwise a placeholder preview). The separate provider `markup` input remains out of scope.
|
||||
- The GPT Image batch node pairs every populated folder through its selected pairing mode and runs the resulting tasks concurrently. It has no random-folder selector or concurrency widget; workflow migration removes both values from older saved nodes.
|
||||
- The Nano Banana batch node's optional colour correction never resizes the generated image, uses only reference image 1, and runs exactly once after generation and before save; its standalone counterpart and `O1keyImageGenerator` have no correction stage.
|
||||
- Route-label changes never alter the serialized values `畅速`, `直连`, and `专线`.
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# 0016: Add Kling 4.0 modes to the released K video node
|
||||
|
||||
- Status: Accepted
|
||||
- Date: 2026-10-30
|
||||
- Owners: Maintainers
|
||||
|
||||
## Context
|
||||
|
||||
Kling 4.0 introduces separate text, keyframe, and Omni reference request
|
||||
paths. The package already ships `K3Video`, and replacing it with a new node or
|
||||
moving its widgets would invalidate saved workflows.
|
||||
|
||||
## Decision
|
||||
|
||||
Keep the `K3Video` node ID and append a `v4` DynamicCombo option. The v4 option
|
||||
owns a `生成模式` selector with `文生视频`, `关键帧`, and `全能参考`. New keyframe
|
||||
and reference sockets are appended after the released input block. Request body
|
||||
validation lives in `clients/kling_video_client.py`; the node continues to use
|
||||
the shared upload, polling, cancellation, and download lifecycle.
|
||||
|
||||
## Consequences
|
||||
|
||||
Existing v3, v2.6, and v3-omni workflows retain their positional widget
|
||||
values. Kling 4.0 supports 3–30 seconds, 720p/1080p, up to ten keyframes, ten
|
||||
reference images, and five reference videos through the new branch. Audio
|
||||
voice-profile inputs and named elements remain outside this first integration
|
||||
because the released node has no compatible AUDIO or element-ID sockets.
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
- A new `Kling4Video` node would avoid a larger schema, but would split the K
|
||||
video user experience and require a second registration and migration path.
|
||||
- Reusing the v3 Omni payload without a mode selector would make text-only and
|
||||
keyframe requests ambiguous and could send mutually exclusive media fields.
|
||||
|
||||
## Validation
|
||||
|
||||
`tests/test_kling_video.py` covers all three payload shapes, capability limits,
|
||||
mutual exclusions, endpoint selection, and the Kling 4.0 result envelope.
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# 0017: Remove retired Nano Banana models from the unified image generator
|
||||
|
||||
- Status: Accepted
|
||||
- Date: 2026-11-08
|
||||
|
||||
## Context
|
||||
|
||||
The unified `O1keyImageGenerator` exposed `Nano Banana 2 Lite` and `Nano Banana` even though the current supported panel set is `Nano Banana 2.1`, `Nano Banana 2`, and `Nano Banana Pro`. Removing those values from the schema without a workflow migration lets ComfyUI replace an old combo value with the first option while configuring a graph after restart.
|
||||
|
||||
## Decision
|
||||
|
||||
The unified catalog and panel expose only the three supported Nano Banana models. Saved unified workflows containing either retired value are migrated before widget restoration to `Nano Banana 2`; the old Lite `512` resolution is migrated to `1K`, which is the closest valid resolution in the replacement model. Standalone `NanoBanana` and `BatchNanoBananaPro` keep their released model values and route mappings.
|
||||
|
||||
The panel normalizes retired values as a defensive fallback for graphs received without the frontend migration. The model label and selected value share one bordered control so the panel matches ComfyUI's native combo-widget presentation.
|
||||
|
||||
## Validation
|
||||
|
||||
- `tests/test_o1key_image_generator.py` verifies the unified schema model list.
|
||||
- `tests/test_o1key_image_generator_frontend.mjs` verifies retired-model normalization, idempotent workflow migration, and the unified model list.
|
||||
@@ -27,3 +27,5 @@ Use ADRs for decisions that constrain future changes: node ID compatibility, pac
|
||||
- [0013: Remove batch Nano Banana random image selection](0013-remove-batch-nano-random-image-selection.md)
|
||||
- [0014: Publish the current code as a new release baseline](0014-new-release-code-baseline.md)
|
||||
- [0015: Canonical image-generator workflow values](0015-image-generator-workflow-values.md)
|
||||
- [0016: Add Kling 4.0 modes to the released K video node](0016-kling-v4-generation-modes.md)
|
||||
- [0017: Remove retired Nano Banana models from the unified image generator](0017-remove-retired-unified-nano-models.md)
|
||||
|
||||
+10
-5
@@ -54,7 +54,7 @@ For Omni Flash, keep `O1keyOmniFlashVideo` as the sole node ID. Its `execute` va
|
||||
- Add or extend a Node-based test for logic that can run without a browser.
|
||||
- For display-only Combo aliases, set `widget.options.getOptionLabel` in an idempotent frontend extension; keep the actual option values unchanged so prompt payloads and saved workflows remain compatible.
|
||||
|
||||
For the image generator, preserve the existing DOM panel and its interaction hierarchy. Keep batch controls and reference upload actions at the top, AI writing inside the prompt area, the randomizer inside the seed row, and generation at the bottom. Restrict style requests to CSS: a single parameter column with left labels/right controls and current ComfyUI theme colours, without button accents. Use legacy input tokens outside the Nodes 2.0 widget host and component-node tokens inside it. Keep backend widgets hidden in both renderers, reapply visibility when renderer options are replaced, and never reorder schema widgets. Serialize only ordered backend values so hidden seed controls and the panel cannot shift later settings. Set `widget.serialize = false` on hidden seed controls before restoration; `options.serialize:false` alone only excludes API prompts. Cover panel identity/action placement, renderer visibility, model switching, upload-to-copy/paste round trips using LiteGraph's restoration loop, and root/subgraph migration with the offline frontend test; compare both renderers and themes using a disposable browser workflow.
|
||||
For the image generator, preserve the existing DOM panel and its interaction hierarchy. Keep batch controls and reference upload actions at the top, AI writing inside the prompt area, the randomizer inside the seed row, and generation at the bottom. Restrict style requests to CSS: a single parameter column with left labels/right controls and current ComfyUI theme colours, without button accents. Use legacy input tokens outside the Nodes 2.0 widget host and component-node tokens inside it. Keep internal prompt/manifest widgets hidden in both renderers, while the released parameter widgets remain visible for LiteGraph's native rows; the native seed widget is replaced by one compact DOM row so its randomizer stays beside the value. Reapply capability visibility when renderer options are replaced, and do not change the relative order of schema widgets. Serialize only ordered backend values so the DOM panel and hidden internal fields cannot shift later settings. Set `widget.serialize = false` on hidden `control_after_generate` widgets before restoration; keep the backend seed value serializable even though its visual widget is replaced. `options.serialize:false` alone only excludes API prompts. Cover panel identity/action placement, native parameter visibility, model switching, upload-to-copy/paste round trips using LiteGraph's restoration loop, and root/subgraph migration with the offline frontend test; compare both renderers and themes using a disposable browser workflow.
|
||||
|
||||
Panel-triggered image batches must be represented in ComfyUI's native task queue, not by task-state text or a cancel action inside `O1keyImageGenerator`. Keep the jobs API bridge idempotent, retain a distinct queue item and expected-output count per batch, route native single and bulk cancellation to `/o1key/image/jobs/{batch_id}/cancel`, and leave the generator action available for consecutive submissions. Preserve native queue/history records returned by ComfyUI when merging o1key records, hydrate persisted terminal summaries before returning the first history page, and keep queue clearing semantics limited to waiting batches. History persistence must remain bounded, atomic, credential-free, and synchronized with native delete/clear actions; a persistence failure must never change the result of a paid generation or successful image save.
|
||||
|
||||
@@ -66,7 +66,9 @@ In automatic multimodal mode, render reference images, videos, and audio cards i
|
||||
|
||||
The video generator defaults new nodes to multimodal mode. Its custom panel is created before saved widget values may be applied, so restore every visible control and material track from the configured node state in `onConfigure`; `loadedGraphNode` must repeat that restoration after graph loading. Never let panel initialization write defaults over a returning workflow's prompt, parameters, manual asset IDs, or `o1keyVideoMedia` properties.
|
||||
|
||||
Keep source/target batching behind the append-only `批量出图` switch. The visible panel must use the industry-neutral names `素材图`, `目标图`, `整组素材 → 多个目标`, `全匹配(素材 × 目标)`, and `单图批量(每张素材独立)`; the historical widget and first two mode values remain compatibility identifiers. Render references as a `102 × 102` horizontal card track with upload and canvas-picker actions in the track header. Every track must retain a trailing add card after its uploaded and pending thumbnails; both that card and the complete track accept external image-file drops. Stop accepted file-drop propagation before ComfyUI's canvas handler while leaving internal thumbnail sorting drags untouched. A drop handled by a nested upload card must clear the `drag` class from both that card and its parent track; the track must not retain a coloured background or outline after the file is released. Track images must use the bounded `/o1key/image/thumbnail` representation, must not decode pending local blobs, and must retain the original `/view` descriptor only for the lightbox; never substitute thumbnail bytes into manifests, prompt optimization, or provider requests. Normal mode shows one `参考图` track; paired batch modes show separate `素材图` and `目标图` tracks, while single-reference mode hides the target track. Header hints must include the current manifest count and the active participation rule. Make the complete thumbnail the pointer drag target rather than rendering a separate handle. During a drag, dim and scale the source card, label it `移动中`, highlight its track, and use a thick insertion edge plus target displacement; suppress the immediate post-drag preview click. Keep `Alt + Arrow/Home/End` ordering on the focused thumbnail as the keyboard path. With the switch off, ignore the stored target manifest and preserve the historical reference/prompt path. With it on, use `expand_image_generation_tasks` as the shared ordering authority for direct and background execution: prompts first, then pairings or source indexes, then per-pair copies. Batch manifests cap at fifty images, but provider requests remain capped at ten references: group mode therefore allows nine sources plus one target, while its target manifest may hold fifty; Cartesian and single-reference source manifests may hold fifty because each task selects one source. Snapshot only manifests used by the active mode, never serialize file paths into a workflow, and reconstruct task-specific references from validated indexes. Load large batch manifests only for active tasks, serialize reference preprocessing to bound full-resolution decode pressure while preserving request order, and release task-local images/tensors immediately after their last consumer. A failed-slot retry must flatten only that slot's exact references into a one-task normal-mode request. Keep request-position thumbnail badges derived from the same ordering. Treat ordered manifests as the source of truth for sorting and persist moves immediately. Uploaded thumbnails must reuse ComfyUI's `MediaLightbox` interaction contract; do not expose signed URLs or open a browser tab. Keep the batch summary hidden until all inputs required by the active mode are present, then show the exact task count, per-item count, prompt multiplier, and total.
|
||||
Keep source/target batching behind the append-only `批量出图` switch. The visible panel must use the industry-neutral names `素材图`, `目标图`, `整组素材→多个目标`, `每张素材×每张目标`, and `每张素材单独出图`; those three strings are the serialized `批量模式` values in both the backend combo and the panel select, so renaming them requires a matching entry in `IMAGE_BATCH_MODE_ALIASES` and in the `migrateUnifiedBatchModeLabels` workflow migration. The widget name `模特图清单` remains a compatibility identifier and is never shown to users. Render references as a `102 × 102` horizontal card track. The track header carries only the lane title and the `画布取图` button; there is no header upload button, and the trailing add card is the single upload entry point (it calls `requestReferenceUpload`, which opens the hidden file input kept beside the track). Every track must retain a trailing add card after its uploaded and pending thumbnails; both that card and the complete track accept external image-file drops. Stop accepted file-drop propagation before ComfyUI's canvas handler while leaving internal thumbnail sorting drags untouched. A drop handled by a nested upload card must clear the `drag` class from both that card and its parent track; the track must not retain a coloured background or outline after the file is released. Track images must use the bounded `/o1key/image/thumbnail` representation, must not decode pending local blobs, and must retain the original `/view` descriptor only for the lightbox; never substitute thumbnail bytes into manifests, prompt optimization, or provider requests. Normal mode shows one `参考图` track; paired batch modes show separate `素材图` and `目标图` tracks, while single-reference mode hides the target track. Header hints show the manifest count only in normal mode (`N 张 · 最多 10 张`); with batching on they are hidden through the `hidden` class because the preview row below the tracks already reports the counts. Make the complete thumbnail the pointer drag target rather than rendering a separate handle. During a drag, dim and scale the source card, label it `移动中`, highlight its track, and use a thick insertion edge plus target displacement; suppress the immediate post-drag preview click. Keep `Alt + Arrow/Home/End` ordering on the focused thumbnail as the keyboard path. With the switch off, ignore the stored target manifest and preserve the historical reference/prompt path. With it on, use `expand_image_generation_tasks` as the shared ordering authority for direct and background execution: prompts first, then pairings or source indexes, then per-pair copies. Batch manifests cap at fifty images, but provider requests remain capped at ten references: group mode therefore allows nine sources plus one target, while its target manifest may hold fifty; Cartesian and single-reference source manifests may hold fifty because each task selects one source. Snapshot only manifests used by the active mode, never serialize file paths into a workflow, and reconstruct task-specific references from validated indexes. Load large batch manifests only for active tasks, serialize reference preprocessing to bound full-resolution decode pressure while preserving request order, and release task-local images/tensors immediately after their last consumer. A failed-slot retry must flatten only that slot's exact references into a one-task normal-mode request. Keep request-position thumbnail badges derived from the same ordering. Treat ordered manifests as the source of truth for sorting and persist moves immediately. Uploaded thumbnails must reuse ComfyUI's `MediaLightbox` interaction contract; do not expose signed URLs or open a browser tab. Keep the batch summary hidden until all inputs required by the active mode are present, then show the pairing detail and the total on one line, in the form `整组 3 张素材 × 4 个目标 = 4 组 · 每组 2 张 · 2 条提示词` plus a highlighted `共 16 张`. `batchGenerationPreview` is the only place that computes this total, and the row must refresh on reference/target changes, mode switches, `生图数量` changes, and prompt edits.
|
||||
|
||||
The generator node's height has exactly one source of truth: `fitNode` plus the dragged-out delta `properties.o1keyPanelExtraHeight`. A `setSize()` that the engine fires on its own (node creation, workflow restore, or the Vue body re-measuring after rows appear) must never move that delta, so `onResize` only treats a resize as a drag when the node has settled **and** the press started on this node's DOM subtree. Use `document.elementFromPoint` for that check on Vue nodes: their DOM box and `canvas.ds.offset` disagree, and the geometry fallback both rejected real grip drags and accepted presses on menus. `onConfigure` has to call `resetCanvasPointerGesture()`, because a press swallowed by a menu row (重启 / 设置) never delivers its `pointerup` and the stale flag then reads every following re-layout as a drag. Bound the accepted pointer travel with `GENERATOR_DRAG_OVERSHOOT` so a stale press cannot fold a screen-wide mouse jump into the panel height. Finally, keep the `GENERATOR_FIT_TOLERANCE` dead zone in `fitNode`: `computeSize` re-derives its number from the laid-out DOM and is noisy by ~18 px, so without a tolerance the node has no fixed point and flips between two heights forever, which reads as the node growing on its own.
|
||||
|
||||
Keep reference-image editing frontend-only and descriptor-based. The top-left thumbnail action may crop and flatten visual mask/brush/arrow marks plus one transformed upper sticker layer into a new PNG, but it must not create a `MASK` value or mutate the GPT mask widget. Keep sticker placement and arrow endpoints in source-image coordinates so preview resizing cannot alter the exported geometry; the arrow tip must remain the exact pointer-release position. Compose annotations above the sticker and never export selection handles. Revoke local sticker object URLs on close and never serialize them. Save through the shared serialized native upload queue with `overwrite=false`, replace the original descriptor only after upload succeeds, and leave the source file untouched. Keep crop math, sticker fit/hit geometry, arrow-head geometry, and filename normalization independently testable in `tests/test_o1key_reference_image_editor.mjs`; run that test together with `test_o1key_image_generator_frontend.mjs` after editor changes.
|
||||
|
||||
@@ -74,7 +76,10 @@ When changing `O1keyImageSave`, preserve the mutually-exclusive preview rules do
|
||||
|
||||
When adding a model to `O1keyImageGenerator`, update `utils/o1key_image_catalog.py`, the frontend model descriptions/capability switch, the job payload validator, and the model-family executor together. Preserve the existing route values even when their labels change. Provider-specific multi-image parameters must not bypass the unified scheduler: each selected output image is one concurrent provider request, and GPT Image always receives `n=1`. Keep GPT-only controls appended after the original generator widgets so old workflow arrays do not shift.
|
||||
|
||||
`utils/nano_banana_models.py` owns the shared Nano Banana model list and route IDs for `NanoBanana`, `BatchNanoBananaPro`, and unified image generation. `Nano Banana 2.1` is first in the model lists and the default in all three schemas, the unified execution method, and frontend fallbacks. Its `畅速 / 直连 / 专线` IDs are `gemini-nano-banana-2.1-sp / gemini-nano-banana-2.1-sd / gemini-nano-banana-2.1`; it shares Nano Banana 2's thinking, online-search, and extended-aspect-ratio support. Keep saved model selections intact, and include every new model in the migration model-recognition set without changing widget order. Verify model IDs, defaults, and parameter forwarding with the Nano Banana dynamic-input, unified image-generator, image-job, and image-generator frontend tests.
|
||||
GPT Image 2.6's `复杂度` remains the last widget in both standalone schemas and at index 23 in the unified schema. Keep its catalog resolver shared by direct execution, background-job normalization/execution and the client. Older models omit `complexity` even if the hidden widget retains a value. SVG/GIF stay gated to GPT Image 2.6 via catalog helpers and frontend format menus; keep append-only `帧数` / `帧时长ms` after `复杂度`. Preserve GIF dual delivery (IMAGE frames + original bytes/path) and SVG path + raster preview. Run `test_gpt_image_nodes.py`, `test_o1key_image_generator.py`, `test_o1key_image_jobs.py`, `test_gpt_image_quality_frontend.mjs` and `test_o1key_image_generator_frontend.mjs`; preserve the nested-graph migration and complexity-value copy/paste cases.
|
||||
|
||||
|
||||
`utils/nano_banana_models.py` owns the shared Nano Banana model list and route IDs for `NanoBanana` and `BatchNanoBananaPro`; the unified image generator publishes the supported first three entries from that list. `Nano Banana 2.1` is first in the model lists and the default in all three schemas, the unified execution method, and frontend fallbacks. Its `畅速 / 直连 / 专线` IDs are `gemini-nano-banana-2.1-sp / gemini-nano-banana-2.1-sd / gemini-nano-banana-2.1`; it shares Nano Banana 2's thinking, online-search, and extended-aspect-ratio support. The unified node migrates retired `Nano Banana 2 Lite` and `Nano Banana` workflow values to `Nano Banana 2` before ComfyUI restores widgets; legacy standalone nodes keep recognizing their released values. Verify model IDs, defaults, migration, and parameter forwarding with the Nano Banana dynamic-input, unified image-generator, image-job, and image-generator frontend tests.
|
||||
|
||||
For Seedream, keep the stable workflow value `Seedream 5.0 Pro` separate from API model ID `dola-seedream-5-0-pro-260628-ep`. Treat the unified panel's default `智能` resolution as an omitted provider `size`; resolve explicit `1K / 2K` plus aspect ratio through the catalog's exact size matrix, submit one image per async task with `n=1`, pass the selected `png / jpeg` as `output_format`, and always send `watermark=false` without adding a widget. Upload ordered references through `{base_url}/v1/o1key/uploads` and submit only the returned HTTPS URL strings; never log those temporary URLs. Layer decomposition is the exception to the normal size/prompt rules: accept exactly one reference, optional prompt text, `智能 / 1K / 1.5K / 2K`, forced PNG, and no batching. Keep all returned images in `z_index` order, preserve transparent provider bytes, expose alpha as MASK in direct execution, and sanitize metadata before it reaches descriptors, history, or workflows.
|
||||
|
||||
@@ -82,11 +87,11 @@ Keep batch-prompt behavior model-independent. A `---` line is the only prompt se
|
||||
|
||||
Do not add a download semaphore or an independent download-concurrency limit to `O1keyImageGenerator`. Ready result URLs must download immediately; the active provider-task scheduler is the only natural bound. The shared Nano transport may retain its optional semaphore for other released nodes, but unified direct and background paths must pass no limiter.
|
||||
|
||||
For GPT Image, keep resolution/aspect-ratio pairs in the catalog size matrix rather than duplicating exact pixel labels in the panel. `智能` is the first and default unified resolution for every model; it must become `None` at the provider boundary so Nano Banana, GPT Image, and Seedream request builders omit `size` entirely. Explicit tiers retain their existing mappings. Keep active user controls in one persistent vertical list with labels on the left and controls on the right, but apply the model capability matrix when synchronizing the model: thinking level and online search are available to Nano Banana 2 and 2.1, resize mode is shared by Nano and GPT Image, and quality, background, API output format, plus mask are GPT Image-only. Online search defaults to `关闭`; omit `google_search` unless it is `打开`, then submit top-level `google_search: true`. The local `格式` field is visible only for Banana models; `命名规则`, `filename_prefix`, and `保存位置` are shared. Hide unsupported fields in place instead of rebuilding them so values and listeners survive model switching. Display `JPEG` but serialize and submit lowercase `jpeg`; new GPT panel selections use `png` while saved values remain intact. Reject `transparent + jpeg` before any paid request and keep JPEG out of the frontend list while transparency is active.
|
||||
For GPT Image, keep resolution/aspect-ratio pairs in the catalog size matrix rather than duplicating exact pixel labels in the panel. `智能` is the first and default unified resolution for every model; it must become `None` at the provider boundary so Nano Banana, GPT Image, and Seedream request builders omit `size` entirely. Explicit tiers retain their existing mappings. New unified image-generator nodes default to `思考等级=高` and `缩放图片=智能缩放`; saved widget values remain unchanged when a workflow is restored. The unified node leaves prompt/reference interactions in its custom DOM panel but lets LiteGraph render the parameter widgets natively; do not duplicate those native controls in the panel. Apply the model capability matrix when synchronizing the model: thinking level and online search are available to Nano Banana 2 and 2.1, resize mode is shared by Nano and GPT Image, and quality, background, API output format, plus mask are GPT Image-only. Online search defaults to `关闭`; omit `google_search` unless it is `打开`, then submit top-level `google_search: true`. The local `格式` field is visible only for Banana models; `命名规则`, `filename_prefix`, and `保存位置` are shared. Hide unsupported fields in place instead of rebuilding them so values and listeners survive model switching. Display `JPEG` but serialize and submit lowercase `jpeg`; new GPT panel selections use `png` while saved values remain intact. The closed select control shows only the selected value; descriptions remain available in the expanded menu. Reject `transparent + jpeg` before any paid request and keep JPEG out of the frontend list while transparency is active.
|
||||
|
||||
Keep prompt writing behind dedicated server routes. The unified image and video prompt actions must retain both the magic-wand icon and the visible `AI帮写` label so their purpose is understandable without hover; the image compatibility route remains `/o1key/image/prompt-optimize`, while video uses `/o1key/video/prompt-write` and a separate video-only system preset. The frontend must submit input descriptors rather than API credentials or filesystem paths. The server must enforce the input-root boundary, preserve reference order, cap the exact multimodal request body, use `gpt-5.6-sol` with high reasoning, and return only the optimized prompt. Tests must mock the upstream completion call and generate reference images at runtime; never add encoded reference fixtures or log complete data URLs.
|
||||
|
||||
Keep unified-generator post-processing, batch, and save widgets in their established order; migrate any removed middle widget before ComfyUI restores saved values. The retired `色彩纠正` value is removed from legacy index 13 before later values are mapped; `背景` occupies index 13; the retired `内容审查强度` value is removed from legacy index 14 after the old-layout migrations. Batch fields occupy indexes 14–16, generator save fields 17–20, `在线搜索` index 21, and Seedream `图层拆分` index 22. `migrateWorkflow.js` must first remove the retired value and fill older generator defaults, then move the connected legacy save node's four positional values into those slots, append later defaults, and clear the old save-node array idempotently. The original `IMAGE` output remains first; new provider-specific outputs must be appended. Display-only collapsing of provider-specific outputs must restore them when their mode is enabled and must never hide a connected output. Layer-decomposition background generation must save the returned descriptors once, then route the base descriptor to the output-0 save node and the remaining descriptors to its paired output-1 layer save node. The frontend, direct V3 execution path, and background job payload must use the same save settings; GPT forces local `格式=原始`.
|
||||
Keep unified-generator post-processing, batch, and save widgets in their established order; migrate any removed middle widget before ComfyUI restores saved values. The retired `色彩纠正` value is removed from legacy index 13 before later values are mapped; `背景` occupies index 13; the retired `内容审查强度` value is removed from legacy index 14 after the old-layout migrations. Batch fields occupy indexes 14–16, generator save fields 17–19, `保存位置` index 20, and Seedream `图层拆分` index 21; the retired `在线搜索` value is removed right after the saved value at index 21 (a string) followed by the `图层拆分` flag. `migrateWorkflow.js` must first remove the retired value and fill older generator defaults, then move the connected legacy save node's four positional values into those slots, append later defaults, and clear the old save-node array idempotently. The original `IMAGE` output remains first; new provider-specific outputs must be appended. Display-only collapsing of provider-specific outputs must restore them when their mode is enabled and must never hide a connected output. Layer-decomposition background generation must save the returned descriptors once, then route the base descriptor to the output-0 save node and the remaining descriptors to its paired output-1 layer save node. The frontend, direct V3 execution path, and background job payload must use the same save settings; GPT forces local `格式=原始`.
|
||||
|
||||
Keep the unified generator's canvas-image picker descriptor-based. Discover current-graph images from public execution outputs and native preview descriptors, fetch them through `/view`, and reuse the serialized `/upload/image` queue before adding them to a reference role. Do not pass `output` or `temp` descriptors to the image-job API, do not serialize picker state, and keep candidate text and filenames out of `innerHTML`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user