Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e18509a4a |
@@ -2,6 +2,7 @@
|
||||
|
||||
Condensed version-by-version index of DEVLOG.md (each line: version + one-line summary of what changed and why). Full rationale, code details, and "How to apply" lessons live in the excluded DEVLOG.md itself; this index exists so graphify can extract a queryable semantic node per release without feeding the full log to the local Ollama model. Regenerate with `python tools/generate_doc_index.py devlog` whenever DEVLOG.md changes.
|
||||
|
||||
- **v0.8.8(2026-10-19)** — MOSS-Image 対応(GenerateUI / Gallery / Metadata / Iタブ)
|
||||
- **v0.8.7(2026-10-16)** — Qwen Image 2.1 Turbo(ComfyUI公式テンプレート T2I / I2I)対応
|
||||
- **v0.8.6(2026-10-14)** — GenerateUI: パートナーAPIノード(Nano Banana 等)の実行に対応
|
||||
- **v0.8.5(2026-10-14)** — Metadata / I タブ: Gemini 系ノード(Nano Banana)の画像を読めるように
|
||||
|
||||
@@ -2,6 +2,26 @@
|
||||
|
||||
---
|
||||
|
||||
## v0.8.8(2026-10-19)
|
||||
|
||||
### MOSS-Image 対応(GenerateUI / Gallery / Metadata / Iタブ)
|
||||
|
||||
ユーザー提供の5本(Base/SFT × T2I/バウンディングボックス、manga 8stepのLoRA構成)で、`convertUiToApi`→`analyzeWorkflow`を実測して直した。
|
||||
|
||||
- **サブグラフの外側ウィジェット値のズレ**: 新フロントエンドは外側ノードに`widgets_values_named`(名前キーの値)も保存し、`inputs[]`にはseed/steps/cfg/sampler/schedulerが載らない一方`widgets_values`は全ポートを持つ。従来の「`inputs[]`内の位置」参照だとunet_nameに25、vae_nameに`er_sde`が入っていた。`_flattenSubgraphs()`で`widgets_values_named`を優先(無い場合は従来どおり)。Iタブ用の複製(`node_sets_menu.js`の`_wfmFlattenSubgraphs`)にも同じ修正。
|
||||
- **`CreateBoundingBoxes`の変換**: `bboxes`の型`BOUNDING_BOX,ARRAY,STRING`が共用体の途中にSTRINGを含むため入力欄と誤判定され、本来の入力欄`editor_state`/`last_incoming`(型`BOUNDING_BOXES`)が読まれていなかった。共用体型は先頭セグメントだけで判定し、`BOUNDING_BOXES`を入力欄型に追加。配列値はAPIでリンク扱いされるため`{"__value__": [...]}`で送る(バックエンドが展開)。Flux.3 Klein 4種にも同ノードがあり、変換前は検証エラーになる出力だったものが直った。
|
||||
- **プロンプト検出**: `MOSSImageLayoutPrompt`の`prompt`をpositiveとして検出(`textKey: prompt`)。リンクされた`PrimitiveStringMultiline`/`PrimitiveString`はロールを上流へ伝播し、リンクのままの値は編集対象にしない(従来は配列がtextに入っていた)。
|
||||
- **Gallery Promptタブ**: APIの`prompt`チャンクが無くサブグラフ入りのUI形式のみの画像は、変換してから抽出(Metadataタブと同じ扱い)。通常の生成画像は従来どおりAPI形式を使う。
|
||||
- 実機(8189)でbboxes版とmanga版の生成成功を確認。ワークフロー357件で変換結果を新旧比較し、差分はFlux.3 Klein 4件のCreateBoundingBoxesのみ。
|
||||
|
||||
### 変換チェック(GenerateUI Check)の初回待ち時間を短縮
|
||||
|
||||
初回に`/object_info`全件(この環境で約26MB・約43秒、毎回)を取得していたのが原因。ワークフロー詳細を開いた時点で全件の先読みも走らせており、サーバーを長時間塞いでいた。
|
||||
|
||||
- `_loadObjectInfoFor(types)`: 使用ノード型(サブグラフ内も含む)だけを`/object_info/<型>`で取得(1型約20ms、16並列、型ごとにキャッシュ)。転送失敗時や、既知の型が1つも無いときは全件にフォールバック。全件キャッシュがあればそれを優先。`invalidateObjectInfoCache()`は型別キャッシュも消す。
|
||||
- 変換(`_convertUiToApiImpl`)と互換性チェックで使用。GenerateUIの初回変換も速くなる。先読みは削除。
|
||||
- MOSSで初回変換 約43秒→約250ms、2回目以降は約2ms。362ワークフローで全件版との変換結果が完全一致。
|
||||
|
||||
## v0.8.7(2026-10-16)
|
||||
|
||||
### Qwen Image 2.1 Turbo(ComfyUI公式テンプレート T2I / I2I)対応
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
|
||||
- Built-in AI tools (translation and more)
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Features (tab -> feature names)
|
||||
|
||||
@@ -53,7 +53,7 @@ Setting / Results / Plan JSON sub-panels, Per-column keyframes, Model column —
|
||||
2-column layout, Collapsible sections, Theme selection, Theme customization, Workflows directory, Gallery output directory, Eagle connection, CivitAI Host, CivitAI API Key, Default workflow, Default Checkpoint, VRAM Management (Ollama), Video Playback Volume, Data Management, Text Size, RAW JSON Colors, GenerateUI Model Tab Highlight, Wildcard Integration, G'MIC-Qt Integration, Language
|
||||
|
||||
### Gallery Tab (v0.3.44)
|
||||
Output / ImagePrompt / Style_Catalog / Metadata sub-tabs, Image browser, Folder tree root label, Thumbnail / Table views, Folder management, File operations, Download, MP4 video support, MP4 embedded metadata, WebM support, Embedded metadata reading fixes, Audio support, File conversion, Move To folder filter, Semantic Search, Audio waveform colors, Info tab: dimensions & duration, Multi-select, Image Compare, Prompt search, Server-side filtering, Group management, Thumbnail F button, Favorites, Detail panel, Prompt tab, Nanobanana tab, Gemini / Nano Banana nodes, Partner API nodes in GenerateUI, Workflow viewer, GenUI button, Image Edit button, Send GenUI Image button, Send to LI node button, Send to LV node button, Send CC button, Search clear (✕), Clear all filters (✕ Clear), Workflow auto-save, Output folder configurable, SVG file support, PSD file support, Performance
|
||||
Output / ImagePrompt / Style_Catalog / Metadata sub-tabs, Image browser, Folder tree root label, Thumbnail / Table views, Folder management, File operations, Download, MP4 video support, MP4 embedded metadata, WebM support, Embedded metadata reading fixes, Audio support, File conversion, Move To folder filter, Semantic Search, Audio waveform colors, Info tab: dimensions & duration, Multi-select, Image Compare, Prompt search, Server-side filtering, Group management, Thumbnail F button, Favorites, Detail panel, Prompt tab, Nanobanana tab, Gemini / Nano Banana nodes, MOSS-Image in GenerateUI, Faster GenerateUI Check / conversion, Partner API nodes in GenerateUI, Workflow viewer, GenUI button, Image Edit button, Send GenUI Image button, Send to LI node button, Send to LV node button, Send CC button, Search clear (✕), Clear all filters (✕ Clear), Workflow auto-save, Output folder configurable, SVG file support, PSD file support, Performance
|
||||
|
||||
### ImagePrompt Gallery subtab (v0.3.94, renamed from Style/Prompt in v0.3.95)
|
||||
Visual prompt library, 3-column layout, Prompt builder (right pane), Plain-text prompt storage, ponyxlWildcardsVault format support, Seed data importer
|
||||
|
||||
@@ -23,7 +23,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
|
||||
- Built-in AI tools (translation and more)
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Screenshots
|
||||
|
||||
@@ -292,6 +292,8 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
|
||||
- **Prompt tab** (v0.4.7) — selected by default (the most frequently checked piece of info shouldn't need an extra click); lists every positive/negative prompt candidate found in the embedded workflow with POS/NEG badges, reusing the exact same list→click→full-text UI as the Metadata tab; extracts from the API-format embedding when available rather than the UI-format one, since a workflow with independent top-level and subgraph sampling chains (e.g. Krea-2) can otherwise have some of its prompts missed; hidden entirely for images in the `cc_nanobanana` folder (see Nanobanana tab below), since they carry no embedded ComfyUI workflow to extract a prompt from
|
||||
- **Nanobanana tab** (v0.7.14) — shown only for images in a `cc_nanobanana` folder (written by ComfyUI Comic Creator's Nanobanana tab) that have a matching entry in that folder's `history.jsonl` generation log; shows engine, model, image size, seed, timestamp, and the prompt/negative prompt actually used — the same info is also surfaced in the Metadata tab (see below) when opened from here via the **Metadata** button
|
||||
- **Gemini / Nano Banana nodes** (v0.8.5) — images generated by ComfyUI's native Nano Banana nodes (`GeminiNanoBanana2V2` etc., e.g. via ComfyUI Comic Creator's "ComfyUI native node" engine) are readable like any other ComfyUI image: the Metadata tab and the side-panel I tab show the prompt (in the prompt list, including the appended `NEGATIVE_PROMPT:` text), the model name (under Diffusion Model, e.g. `Gemini Nano Banana 2.1`) and the seed; these images need no history file and are not special-cased like the `cc_nanobanana` folder (API-format workflows only)
|
||||
- **MOSS-Image in GenerateUI** (v0.8.8) — the MOSS-Image templates (Base / SFT, T2I and the bounding-box layout versions, plus the 8-step distillation LoRA setup) load and run from GenerateUI. The `MOSSImageLayoutPrompt` text is edited as the positive prompt, `CreateBoundingBoxes` converts correctly (the boxes themselves are still drawn on ComfyUI's canvas), and the Gallery Prompt tab, Metadata tab and side-panel I tab read the prompt, models and sampler settings of MOSS images. Newer frontends save subgraph widget values by name (`widgets_values_named`); these are now read correctly, so model names and sampler values no longer shift
|
||||
- **Faster GenerateUI Check / conversion** (v0.8.8) — the first conversion or check used to download the full `/object_info` (tens of MB, 40+ s on installs with many custom nodes); it now fetches only the node types the workflow uses (about 0.25 s) and caches them per type
|
||||
- **Partner API nodes in GenerateUI** (v0.8.6) — workflows containing ComfyUI's partner API nodes (Nano Banana / Gemini image nodes, etc.) can be run from GenerateUI. These nodes need Comfy credentials in the `/prompt` request's `extra_data`, which ComfyUI's own screen adds automatically but a separate page cannot: add `COMFY_API_KEY=...` (a Comfy API key issued at platform.comfy.org) to the plugin's `.env` and restart ComfyUI. With it set, GenerateUI queues prompts through the plugin server (`/api/wfm/partner/prompt`), which adds the key only when the workflow contains an API node (`api_node` in `/object_info`) and only for this ComfyUI instance; the key never reaches the browser, and usage is billed as Comfy credits. Without a key, an authentication error now shows how to set it up. A Gemini image node's prompt shows in the Prompt tab (reference images go through `LoadImage` in the Image tab); sample: `ws_nano_banana_2_1_t2i`. Also fixed: UI-format → API-format conversion misaligned `widgets_values` for nodes whose DynamicCombo option has socket sub-inputs (Nano Banana 2.1's `images` / `files`) or a widget right after a `control_after_generate` seed; Gallery now shows the Prompt tab for `cc_nanobanana`-folder images that carry embedded metadata (images made through Comic Creator's ComfyUI native node engine)
|
||||
- **Workflow viewer** — Metadata tab displays workflow JSON from PNG embedded data (`prompt` / `workflow` keys) or from workflow saved by the Generate UI tab; **Copy & Send Canvas** button copies the JSON to the clipboard and sends the workflow directly to the ComfyUI canvas (UI and API formats both supported)
|
||||
- **GenUI button** (renamed from "Load GenUI" in v0.5.0 for readability) — loads the embedded ComfyUI workflow from the selected image directly into the GenerateUI tab; shows a warning toast if no workflow is embedded or the format is unsupported; Metadata button is styled green, GenUI button uses the primary accent color
|
||||
@@ -343,13 +345,13 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
|
||||
- **MP4 embedded metadata** (v0.5.1) — reads the `workflow`/`prompt` container tags ComfyUI's `SaveVideo` writes into the mp4's `moov/udta/meta` box (parsed client-side, no server round-trip); also recognizes all-in-one video-generation nodes that carry their prompt directly on a `prompt` input instead of a separate `CLIPTextEncode`-style node (e.g. `MiniMaxH3ImageToVideo`); WebM isn't supported here (this parser only understands MP4's ISO-BMFF container) — the Gallery tab's own video metadata reading (PyAV-based, see Gallery Tab above) covers WebM instead
|
||||
- **Settings section** (v0.7.14) — image size (width×height) and, when the embedded workflow has a KSampler-type node, its Seed / Steps / CFG / Sampler / Scheduler / Denoise values, read from the API-format embedding's named inputs (UI-format workflows are converted through the same UI→API path GenerateUI uses first)
|
||||
- **Nanobanana section** (v0.7.14) — shown only for images from ComfyUI Comic Creator's Nanobanana tab (a `cc_nanobanana`-folder image opened via the Gallery tab's **Metadata** button, with a matching entry in that folder's `history.jsonl` log); shows engine, model, image size, seed, timestamp, and the prompt/negative prompt actually used — since these images carry no embedded ComfyUI workflow, this section's data replaces what would otherwise be a "no metadata found" error, with the rest of the layout (Checkpoint/LoRA/Prompt/Settings) simply staying empty
|
||||
- **Model extraction** — automatically extracts Checkpoint, VAE, Diffusion Model, and Text Encoder names from the workflow; supports both standard and subgraph-based workflows (Flux.2 Dev/Klein, Qwen-Image-Edit/2511/Layered, Z-Image Base/Turbo, Ernie Image, WAN2.2, Mage-Flow, LongCat, Boogu, HiDream E1, FireRed, Krea-2 Turbo); node types covered: UNETLoader, UnetLoaderGGUF, UNETLoaderGGUF (e.g. HiDream GGUF), CLIPLoader, DualCLIPLoader, TripleCLIPLoader, QuadrupleCLIPLoader (e.g. HiDream 4-CLIP)
|
||||
- **Model extraction** — automatically extracts Checkpoint, VAE, Diffusion Model, and Text Encoder names from the workflow; supports both standard and subgraph-based workflows (Flux.2 Dev/Klein, Qwen-Image-Edit/2511/Layered, Z-Image Base/Turbo, Ernie Image, WAN2.2, Mage-Flow, LongCat, Boogu, HiDream E1, FireRed, Krea-2 Turbo, MOSS-Image); node types covered: UNETLoader, UnetLoaderGGUF, UNETLoaderGGUF (e.g. HiDream GGUF), CLIPLoader, DualCLIPLoader, TripleCLIPLoader, QuadrupleCLIPLoader (e.g. HiDream 4-CLIP)
|
||||
- **LoRA extraction** — lists all LoRA models with `strength_model / strength_clip` values
|
||||
- **Prompt extraction** — lists prompts with POS / NEG badges when positive/negative can be determined; when distinction is not possible (e.g. `SamplerCustomAdvanced`, intermediate nodes, cross-level connections), prompts are shown without a badge as plain **Text**; click any entry to view the full text below
|
||||
- **CLIP Text Encode edit+ support** (v0.3.92) — `CLIPTextEncodeEditPlus` nodes are resolved using the same RAW / EDIT / front / back combination rule as the node itself, correctly merging the linked `text1` (e.g. a Lora Manager's trigger words) with the editable `text_edit` field instead of showing only one side
|
||||
- **Custom multi-output text node fix** (v0.7.14) — nodes whose text output comes from a differently-named widget (e.g. ComfyUI-LiveChatStream's `response`/`positive`/`negative` outputs, backed by `response_text`/`prompt_text`/`negative_text` widgets) previously resolved to nothing when the API-format embedding was used, since the generic key lookup didn't recognize those widget names — LiveChatStream is now resolved by name explicitly; confirmed working with response text up to 40,000 characters
|
||||
- **Prompt actions** — Copy to clipboard, **GenUI:P/N** (set GenerateUI positive/negative prompt), **Prompt:P/N** (set Prompt tab preset positive/negative)
|
||||
- **Format support** — ComfyUI PNG/WebP/MP4/JSON (standard + Flux.2 / Qwen-Image / Z-Image / Ernie Image / WAN2.2 / Mage-Flow / LongCat / Boogu / HiDream E1 / FireRed / Krea-2 Turbo subgraph workflows), SD WebUI, SD Forge, Fooocus
|
||||
- **Format support** — ComfyUI PNG/WebP/MP4/JSON (standard + Flux.2 / Qwen-Image / Z-Image / Ernie Image / WAN2.2 / Mage-Flow / LongCat / Boogu / HiDream E1 / FireRed / Krea-2 Turbo / MOSS-Image subgraph workflows), SD WebUI, SD Forge, Fooocus
|
||||
- **Format note** — supported formats and covered model types are always shown in the left column
|
||||
|
||||
</details>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-workflow-studio"
|
||||
description = "A comprehensive workflow, asset management, and generation UI plugin for ComfyUI. Manage workflows, models, images, and prompts; batch generation and Image Feeder in the GenerateUI tab; library side panel with canvas drag & drop and AI tools."
|
||||
version = "0.8.7"
|
||||
version = "0.8.8"
|
||||
license = { file = "LICENSE" }
|
||||
requires-python = ">= 3.10"
|
||||
dependencies = ["jinja2"]
|
||||
|
||||
@@ -74,12 +74,51 @@ async function _loadObjectInfo() {
|
||||
return _objectInfoCache || {};
|
||||
}
|
||||
|
||||
// Per-node-type object_info (GET /object_info/<type>, ~20 ms each). The full /object_info is
|
||||
// tens of MB and can take 10-40 s on installs with many custom nodes, so conversions and the
|
||||
// compatibility check only fetch the types the workflow actually uses. type -> info, or null when
|
||||
// ComfyUI doesn't know the type. Only successful responses are cached.
|
||||
const _objectInfoByType = new Map();
|
||||
|
||||
async function _loadObjectInfoFor(types) {
|
||||
if (_objectInfoCache) return _objectInfoCache;
|
||||
const wanted = [...new Set(types)].filter((ty) => typeof ty === "string" && ty && !_objectInfoByType.has(ty));
|
||||
let failed = false;
|
||||
for (let i = 0; i < wanted.length; i += 16) {
|
||||
await Promise.all(wanted.slice(i, i + 16).map(async (ty) => {
|
||||
try {
|
||||
const res = await fetch(`/object_info/${encodeURIComponent(ty)}`);
|
||||
if (!res.ok) { if (res.status === 404) _objectInfoByType.set(ty, null); else failed = true; return; }
|
||||
const data = await res.json();
|
||||
_objectInfoByType.set(ty, data?.[ty] || null);
|
||||
} catch { failed = true; }
|
||||
}));
|
||||
}
|
||||
// Any transport failure: fall back to the full snapshot rather than report types as unknown
|
||||
if (failed) return _loadObjectInfo();
|
||||
const out = {};
|
||||
for (const ty of types) { const info = _objectInfoByType.get(ty); if (info) out[ty] = info; }
|
||||
return out;
|
||||
}
|
||||
|
||||
// Node types a UI-format workflow uses, including nodes inside subgraph definitions
|
||||
function _collectNodeTypes(workflow) {
|
||||
const sgIds = new Set((workflow?.definitions?.subgraphs || []).map((sg) => sg.id));
|
||||
const types = new Set();
|
||||
const add = (nodes) => { for (const n of nodes || []) if (n?.type && !sgIds.has(n.type)) types.add(n.type); };
|
||||
add(workflow?.nodes);
|
||||
for (const sg of workflow?.definitions?.subgraphs || []) add(sg.nodes);
|
||||
return [...types];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ordered widget (non-link) input names for a node class from object_info.
|
||||
* These correspond to widgets_values in UI-format nodes.
|
||||
*/
|
||||
// Scalar widget types object_info can declare for a required/optional input.
|
||||
const _WIDGET_TYPE_SET = new Set(["INT", "FLOAT", "STRING", "BOOLEAN", "COMBO", "COMFY_DYNAMICCOMBO_V3"]);
|
||||
// BOUNDING_BOXES: CreateBoundingBoxes' canvas widgets (editor_state / last_incoming) — array-valued
|
||||
// frontend widgets that occupy a widgets_values slot; sent to the API as {"__value__": [...]}.
|
||||
const _WIDGET_TYPE_SET = new Set(["INT", "FLOAT", "STRING", "BOOLEAN", "COMBO", "COMFY_DYNAMICCOMBO_V3", "BOUNDING_BOXES"]);
|
||||
|
||||
/**
|
||||
* Resolve a possibly-compound object_info type spec (e.g. LTXVEmptyLatentAudio's frame_rate:
|
||||
@@ -100,11 +139,10 @@ function _resolveWidgetType(type, spec) {
|
||||
if (typeof type !== "string") return null;
|
||||
const explicit = spec?.[1]?.widgetType;
|
||||
if (typeof explicit === "string" && _WIDGET_TYPE_SET.has(explicit.toUpperCase())) return explicit.toUpperCase();
|
||||
for (const part of type.split(",")) {
|
||||
const upper = part.trim().toUpperCase();
|
||||
if (_WIDGET_TYPE_SET.has(upper)) return upper;
|
||||
}
|
||||
return null;
|
||||
// Only the first (default) segment decides: a union that merely *accepts* a scalar as one of its
|
||||
// link types (CreateBoundingBoxes.bboxes: "BOUNDING_BOX,ARRAY,STRING") is still a link-only socket.
|
||||
const first = type.split(",")[0].trim().toUpperCase();
|
||||
return _WIDGET_TYPE_SET.has(first) ? first : null;
|
||||
}
|
||||
|
||||
function _getWidgetInputNames(objectInfo, classType) {
|
||||
@@ -551,9 +589,19 @@ function _flattenSubgraphs(workflow, objectInfo) {
|
||||
const port = sgDef.inputs[portIdx];
|
||||
const outerInp = outerWidgetInputs.find((inp) => inp.name === port.name);
|
||||
const outerWidgetIdx = outerInp ? outerWidgetInputs.indexOf(outerInp) : -1;
|
||||
const hasOuterOverride = !!outerInp && outerInp.link == null && outerWidgetIdx !== -1
|
||||
&& outerWidgetIdx < (node.widgets_values || []).length;
|
||||
const outerValue = hasOuterOverride ? node.widgets_values[outerWidgetIdx] : undefined;
|
||||
// Newer frontends also save a name-keyed copy of the outer widget values
|
||||
// (widgets_values_named) and may omit widget ports (seed/steps/cfg/...) from the outer
|
||||
// node's inputs[] while widgets_values still holds every port, so the index-among-inputs
|
||||
// lookup drifts (e.g. MOSS-Image: unet_name read the steps value). Prefer the named copy.
|
||||
const named = node.widgets_values_named;
|
||||
const hasNamed = !!named && typeof named === "object"
|
||||
&& Object.prototype.hasOwnProperty.call(named, port.name);
|
||||
const hasOuterOverride = hasNamed
|
||||
? !(outerInp && outerInp.link != null)
|
||||
: (!!outerInp && outerInp.link == null && outerWidgetIdx !== -1
|
||||
&& outerWidgetIdx < (node.widgets_values || []).length);
|
||||
const outerValue = !hasOuterOverride ? undefined
|
||||
: (hasNamed ? named[port.name] : node.widgets_values[outerWidgetIdx]);
|
||||
|
||||
// Value to apply to non-widget (wildcard) fan-out targets: the outer override if
|
||||
// present, otherwise whatever a sibling widget-type target ends up holding (its own
|
||||
@@ -661,6 +709,11 @@ export const comfyWorkflow = {
|
||||
return _loadObjectInfo();
|
||||
},
|
||||
|
||||
// object_info limited to the given node types (fast; see _loadObjectInfoFor)
|
||||
async getObjectInfoForTypes(types) {
|
||||
return _loadObjectInfoFor(types);
|
||||
},
|
||||
|
||||
getLastBypassedNodes() {
|
||||
return _lastBypassedNodes;
|
||||
},
|
||||
@@ -679,6 +732,7 @@ export const comfyWorkflow = {
|
||||
// at the top) would replace it with an unrelated pre-existing file instead.
|
||||
invalidateObjectInfoCache() {
|
||||
_objectInfoCache = null;
|
||||
_objectInfoByType.clear();
|
||||
},
|
||||
|
||||
// opts.readOnly: 表示用の読み取り変換。COMBO値の差し替えを行わず、Workflowタブの互換性
|
||||
@@ -700,7 +754,7 @@ export const comfyWorkflow = {
|
||||
_lastMutedNodes = [];
|
||||
if (!workflow.nodes || !workflow.links) return {};
|
||||
|
||||
const objectInfo = await _loadObjectInfo();
|
||||
const objectInfo = await _loadObjectInfoFor(_collectNodeTypes(workflow));
|
||||
|
||||
// Flatten subgraphs before conversion (needs objectInfo to correctly map outer
|
||||
// subgraph-node widget values onto internal nodes' widgets_values indices)
|
||||
@@ -890,6 +944,9 @@ export const comfyWorkflow = {
|
||||
}
|
||||
}
|
||||
}
|
||||
// List values are reserved for node links in the API format; the backend unwraps
|
||||
// {"__value__": [...]} for array-valued widgets.
|
||||
if (expectedType === "BOUNDING_BOXES" && Array.isArray(val)) val = { __value__: val };
|
||||
inputs[name] = val;
|
||||
}
|
||||
} else {
|
||||
@@ -1216,6 +1273,15 @@ export const comfyWorkflow = {
|
||||
if (isNeg) samplerNegativeRef[sv[0]] = true;
|
||||
}
|
||||
}
|
||||
// PrimitiveStringMultiline/PrimitiveString whose value is linked (MOSS-Image's
|
||||
// layout-prompt workflows feed it from a PreviewAny relay) — pass the role upstream.
|
||||
if (ct === "PrimitiveStringMultiline" || ct === "PrimitiveString") {
|
||||
const tv = inputs.value;
|
||||
if (Array.isArray(tv)) {
|
||||
if (isPos) samplerPositiveRef[tv[0]] = true;
|
||||
if (isNeg) samplerNegativeRef[tv[0]] = true;
|
||||
}
|
||||
}
|
||||
// StringConcatenate — appends e.g. a LoRA trigger word onto the prompt text
|
||||
// (Krea-2); propagate role through both operands so the upstream literal is found.
|
||||
if (ct === "StringConcatenate") {
|
||||
@@ -1524,7 +1590,19 @@ export const comfyWorkflow = {
|
||||
}
|
||||
|
||||
// PrimitiveStringMultiline / PrimitiveString — when feeding a prompt node
|
||||
if ((ct === "PrimitiveStringMultiline" || ct === "PrimitiveString") && (isPos || isNeg)) {
|
||||
// MOSSImageLayoutPrompt (MOSS-Image bounding-box layout) — builds the final prompt from its own
|
||||
// "prompt" widget (whole-image description) plus the CreateBoundingBoxes elements.
|
||||
if (ct === "MOSSImageLayoutPrompt" && typeof inputs.prompt === "string" && (isPos || isNeg)) {
|
||||
result.prompt_nodes.push({
|
||||
id, type: ct, title, role: getRole(),
|
||||
text: inputs.prompt, textKey: "prompt",
|
||||
});
|
||||
}
|
||||
|
||||
// PrimitiveStringMultiline / PrimitiveString — when feeding a prompt node (a linked
|
||||
// value has no literal to edit; its role is propagated upstream in Pass 1b instead)
|
||||
if ((ct === "PrimitiveStringMultiline" || ct === "PrimitiveString") && (isPos || isNeg)
|
||||
&& !Array.isArray(inputs.value)) {
|
||||
result.prompt_nodes.push({
|
||||
id, type: ct, title, role: getRole(),
|
||||
text: inputs.value || "",
|
||||
|
||||
@@ -1093,7 +1093,16 @@ async function loadImageDetail(img) {
|
||||
// Promptタブは prompt_workflow (API形式優先) を使う。トップレベルとサブグラフに
|
||||
// 独立した複数系統を持つワークフローでは workflow (UI形式) からの抽出だと
|
||||
// トップレベル系統しか拾えないことがあるため(Metadataタブと同じ優先順位に揃える)。
|
||||
renderPromptTab(wfRes.prompt_workflow ?? state.embeddedWorkflow, metaRes.embedded);
|
||||
let promptWf = wfRes.prompt_workflow ?? state.embeddedWorkflow;
|
||||
// サブグラフを持つUI形式(API形式のpromptチャンクが無い画像)は、外側ノードの実際の値を
|
||||
// 反映するため変換してから抽出する(Metadataタブと同じ扱い)。失敗時は元の形式のまま。
|
||||
if (Array.isArray(promptWf?.nodes) && promptWf.definitions?.subgraphs?.length > 0) {
|
||||
try {
|
||||
const converted = await comfyWorkflow.convertUiToApi(promptWf, { readOnly: true });
|
||||
if (converted && Object.keys(converted).length > 0) promptWf = converted;
|
||||
} catch { /* keep UI format */ }
|
||||
}
|
||||
renderPromptTab(promptWf, metaRes.embedded);
|
||||
} catch (e) {
|
||||
renderWorkflowJson(null);
|
||||
_updateCopyCanvasBtn();
|
||||
|
||||
@@ -65,7 +65,11 @@ async function _checkConversion(raw, filename) {
|
||||
} catch (e) {
|
||||
return { status: "error", lines: [t("compatConvertFailed", e.message || String(e))] };
|
||||
}
|
||||
const objectInfo = await comfyWorkflow.getObjectInfo();
|
||||
// Only the node types in use are needed — the full /object_info can take tens of seconds
|
||||
const usedTypes = [...new Set(Object.values(api || {}).map((n) => n?.class_type).filter(Boolean))];
|
||||
let objectInfo = await comfyWorkflow.getObjectInfoForTypes(usedTypes);
|
||||
// Nothing known at all: either every type is missing or the server is unreachable — only the full snapshot can tell
|
||||
if (Object.keys(objectInfo).length === 0 && usedTypes.length > 0) objectInfo = await comfyWorkflow.getObjectInfo();
|
||||
if (format === "api") subs = _comboMismatches(api, objectInfo);
|
||||
|
||||
const ids = Object.keys(api || {});
|
||||
|
||||
@@ -1110,8 +1110,6 @@ function openDetailModal(wf) {
|
||||
getRawWorkflow(wf.filename)
|
||||
.then((raw) => setFormatBadge(document.getElementById("wfm-detail-format-badge"), comfyWorkflow.detectFormat(raw, wf.filename)))
|
||||
.catch(() => {});
|
||||
// Warm the /object_info cache (large; ~10 s on first fetch) so the check button answers quickly
|
||||
comfyWorkflow.getObjectInfo();
|
||||
document.getElementById("wfm-detail-compat-check")?.addEventListener("click", async () => {
|
||||
const btn = document.getElementById("wfm-detail-compat-check");
|
||||
const el = document.getElementById("wfm-detail-compat-result");
|
||||
|
||||
@@ -2962,10 +2962,16 @@ function _wfmFlattenSubgraphs(workflow, objectInfo) {
|
||||
}
|
||||
|
||||
const outerWidgetInputs = (node.inputs || []).filter((inp) => inp.widget);
|
||||
// widgets_values_named (name-keyed copy saved by newer frontends, e.g. MOSS-Image): outer inputs[]
|
||||
// may omit widget ports (seed/steps/...) while widgets_values holds every port, so the index
|
||||
// lookup below would drift — see static/js/comfyui-workflow.js _flattenSubgraphs.
|
||||
const namedOuter = node.widgets_values_named;
|
||||
const hasNamedOuter = !!namedOuter && typeof namedOuter === "object";
|
||||
outerWidgetInputs.forEach((inp, widgetIdx) => {
|
||||
if (inp.link != null) return;
|
||||
if (widgetIdx >= (node.widgets_values || []).length) return;
|
||||
const outerValue = node.widgets_values[widgetIdx];
|
||||
const useNamed = hasNamedOuter && Object.prototype.hasOwnProperty.call(namedOuter, inp.name);
|
||||
if (!useNamed && widgetIdx >= (node.widgets_values || []).length) return;
|
||||
const outerValue = useNamed ? namedOuter[inp.name] : node.widgets_values[widgetIdx];
|
||||
|
||||
const portIdx = (sgDef.inputs || []).findIndex((p) => p.name === inp.name);
|
||||
if (portIdx === -1) return;
|
||||
|
||||
Reference in New Issue
Block a user