{#snippet fieldError(inp: ComfyDynamicInput)} {#if showErrors && errors[inp.nodeId]?.trim()}{errors[inp.nodeId]}{/if} {/snippet} {#snippet actions()} {#if endpointId} {queueCount > 0 ? t('studio.chipBusy', { name: selectedEndpointName, n: queueCount }) : t('studio.chipIdle', { name: selectedEndpointName })} {/if} {/snippet}
{#if !$settingsQuery.isLoading && !endpoints.length}

{t('studio.errNoConn')}

{t('studio.connManage')}
{:else if !kindWorkflows.length}

{t('studio.wfEmptyTitle', { kind: kind === 'image' ? t('studio.kindImageText') : t('studio.kindVideoText') })}

{t('studio.wfEmptyGo')}
{:else}

{t('studio.genParams')}

{#if currentWorkflow} {modeLabel} {/if}
{#if dryRun}

{t('studio.dryRunNote')}

{/if}
{t('studio.connLabel')} {#if connRec?.ok} {t('studio.connOk', { ms: connRec.ms ?? '?' })} {:else if connRec?.ok === false} {t('studio.connFail')} {:else} {t('studio.connUntested')} {/if} · {t('studio.connQueue', { n: queueCount })} {#if showErrors && errors.conn}{errors.conn}{/if}
{t('studio.wfLabel')} {#if currentWorkflow} {t('studio.wfParams', { n: currentWorkflow.input_schema?.length ?? 0 })} · {#if currentWorkflow.endpoint_id} {t('studio.wfBindTo', { name: endpoints.find((e) => e.id === currentWorkflow.endpoint_id)?.name ?? '?', })} {:else} {t('studio.wfFollowActive')} {/if} {/if} {#if currentWorkflow && !schema.length}

{t('studio.wfNoParamsNote')}

{:else if schema.some((i) => i.auto)}

{t('studio.wfAutoParamsNote', { n: schema.length })}

{/if} {#if brokenReasons.length} {/if}
{#if mediaSlots.length} {@const pairKey = `${mediaSlots.find((s) => isFirstFrame(s.inp))?.inp.nodeId ?? ''}|${mediaSlots.find((s) => isLastFrame(s.inp))?.inp.nodeId ?? ''}`}
{#each mediaSlots as s (s.inp.nodeId)} {@const reject = slotRejects[s.inp.nodeId]?.[0]} {#if s.inp.kind === 'video' || s.inp.kind === 'audio'}
slotFile(s.inp.nodeId, f, s.mediaKind)} onClear={() => setVal(s.inp.nodeId, '')} />
{:else}
slotFile(s.inp.nodeId, f)} onFromResults={() => openPicker(s.inp.nodeId)} onClear={() => { setRejects(s.inp.nodeId, []); setVal(s.inp.nodeId, ''); }} />
{/if} {/each}
{#if showErrors && errors[pairKey]} {errors[pairKey]} {/if} {/if} {#if listGroups.length}
{#each listGroups as entry (entry.nodeId)} groupAdd(entry, files)} onReplace={(i, file) => groupReplace(entry, i, file)} onRemove={(i) => groupRemove(entry, i)} onDismissReject={(i) => setRejects(entry.nodeId, (slotRejects[entry.nodeId] ?? []).filter((_, j) => j !== i))} onFromResults={entry.kind === 'image_list' ? () => openPicker(entry.nodeId) : undefined} /> {/each} {#if hasH3Hint}

{t('wfMedia.h3Limits')}

{#each h3SoftWarnings as w (w)}

{w}

{/each}
{/if}
{/if} {#if promptInp} {:else if currentWorkflow} {/if}
{#if negInp} {/if} {#if seedInp} {/if}
{#if ratioInp}
{#if megapixelsInp} {/if}
{:else if widthInp && heightInp}
{t('studio.sizeLabel')}
numVal(widthInp.nodeId, e.currentTarget.value)} /> × numVal(heightInp.nodeId, e.currentTarget.value)} />
{@render fieldError(widthInp)} {@render fieldError(heightInp)}
{:else if resolutionInp} {/if} {#if stepsInp || cfgInp || denoiseInp || batchInp || durationInp || fpsInp}
{#if durationInp} {/if} {#if fpsInp} {/if} {#if batchInp} {/if} {#if stepsInp} {/if} {#if cfgInp} {/if} {#if denoiseInp} {/if}
{/if} {#if restInputs.length}
{t('studio.paramsTitle')}
{#each restInputs as inp (inp.nodeId)} {/each}
{/if}
{t('studio.etaHint')}
{/if}
{#if !kindWorkflows.length}

{t('studio.wfEmptyTitle', { kind: kind === 'image' ? t('studio.kindImageText') : t('studio.kindVideoText') })}

{t('studio.wfEmptyBody', { kind: kind === 'image' ? t('studio.kindImageText') : t('studio.kindVideoText') })}

{kind === 'image' ? t('studio.missingQwen') : t('studio.missingFirstLast')}

{:else}
{kind === 'image' ? t('studio.kindImageText') : t('studio.kindVideoText')} {activeJob ? wfName(activeJob) : t('studio.noActiveTask')} {#if activeJob && (activeJob.status === 'pending' || activeJob.status === 'running')} {/if}
{#if activeJob}
{#if activeJob.status === 'pending'}
{activeStatus?.label}
{activeStatus?.detail} · {t('studio.queuedBehind', { n: jobsAhead })}
{:else}
{activeStatus?.label}
{activeStatus?.detail} · {t('studio.usedShort', { v: elapsedOf(activeJob) })} {#if etaSec != null} · {t('studio.etaShort', { v: fmtDur(etaSec) })}{/if} · {t('studio.targetShort', { name: endpointName })}
{/if}
{/if}
{#if kind === 'image'}

{t('studio.resultsTitle')}

{#if doneEntries.length}{doneEntries.length}{/if}
{#if doneEntries.length}
{#each doneEntries as entry (entry.key)} {/each}
{#if selectedEntry}
{summaryOf(selectedEntry.job)} {t('studio.download')}
{/if} {:else}

{kind === 'image' ? t('studio.historyEmptyImage') : t('studio.historyEmptyVideo')}

{/if}
{:else}

{t('studio.video.resultsTitle')}

{#if selectedEntry} {wfName(selectedEntry.job)} · {t('studio.doneAt', { time: fmtTime(parseDbTs(selectedEntry.job.completed_at ?? selectedEntry.job.created_at)), })} {/if}
{#if selectedEntry}
{#if !playing} {/if} {#if durSec} {fmtClock(durSec)} {/if}
{fmtClock(curSec)} / {fmtClock(durSec)}
{#if selectedFrames.length}
{selectedRefCount ? t('studio.refStrip', { n: selectedRefCount }) : t('studio.videoRefStrip')} {#each selectedFrames as fr (fr.path)}
{fr.label} {fr.label}
{/each}
{/if}
{summaryOf(selectedEntry.job)} {t('studio.downloadMp4')}
{:else}

{t('studio.historyEmptyVideo')}

{/if}
{/if} {/if}
assetUrl(e.path) ?? '')} index={Math.max(0, doneEntries.findIndex((e) => e.key === selectedEntry?.key))} onClose={() => (lightboxOpen = false)} /> (pickerFor = null)}> {#if imageResults.length}
{#each imageResults as entry (entry.path)} {/each}
{:else}

{t('studio.pickerEmpty')}

{/if}
{ deleteJobId = null; deleteOpen = false; }} />