fix: untagged ComfyUI workflows expose inputs; studio generate always gives feedback (HEL-623)
Root cause: parse_dynamic_inputs only recognised (Input:role) title tags. A workflow exported straight from ComfyUI has default titles, so its input_schema was empty and the studio form rendered no prompt box; the generate click then enqueued (or was blocked) with no toast at all. - parser: untagged fallback detects prompt/negative (via wiring to sampler positive/negative), seed/steps/cfg, latent width/height/batch, numeric primitives, LoadImage/LoadImageMask/video/audio slots; only the prompt is required; entries carry auto=true - patcher: "<nodeId>@<widget>" keys target one widget on multi-widget nodes, never overwrite linked inputs; LoadImageMask uploads like images - workflows API re-derives an empty stored schema (old imports fixed without re-import); smart_fill sort accepts subgraph/field ids - studio: blocked submit toasts the reason and scrolls to the field; success toasts "已提交"; submit errors show the API detail; job.failed for this window's jobs toasts the reason; no-param workflows show a note + disabled prompt box; auto-detected params show a note - connections import: chip shows node count, toast reports real params - Chinese messages for ComfyUI rejection/upload/timeout/execution errors and playground workflow-not-found/disabled - tests: native Qwen t2i / Qwen edit+mask / untagged H3 fixtures, patch keys, backfill, full fake-ComfyUI chain, Chinese rejection Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
multica-agent
parent
1a7a682cd0
commit
063a3c7063
@@ -161,6 +161,28 @@ async function api<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
return res.json() as Promise<T>;
|
||||
}
|
||||
|
||||
/** Readable text for an api() failure: FastAPI `detail`, not the raw "400: {json}". */
|
||||
export function apiErrorMessage(err: unknown): string {
|
||||
if (err instanceof TypeError) return t("api.networkError");
|
||||
const raw = err instanceof Error ? err.message : String(err);
|
||||
const m = /^(\d{3}): ([\s\S]*)$/.exec(raw);
|
||||
if (!m) return raw;
|
||||
try {
|
||||
const detail = (JSON.parse(m[2]) as { detail?: unknown }).detail;
|
||||
if (typeof detail === "string" && detail) return detail;
|
||||
if (Array.isArray(detail) && detail.length) {
|
||||
return detail
|
||||
.map((d) =>
|
||||
d && typeof d === "object" && "msg" in d ? String(d.msg) : String(d),
|
||||
)
|
||||
.join(";");
|
||||
}
|
||||
} catch {
|
||||
/* non-JSON body */
|
||||
}
|
||||
return t("api.httpError", { status: m[1], detail: m[2].slice(0, 200) });
|
||||
}
|
||||
|
||||
/** Multipart variant of api() — FormData sets its own Content-Type boundary. */
|
||||
async function apiUpload<T>(path: string, form: FormData): Promise<T> {
|
||||
const res = await fetch(`${API_BASE}${path}`, { method: "POST", body: form });
|
||||
|
||||
Reference in New Issue
Block a user