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 `专线`.
|
||||
|
||||
Reference in New Issue
Block a user