Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: expand video queue retry editor

[._.]/ Adam Eivy63c57dda3d32
diff --git a/client/src/components/media/MediaJobsQueue.jsx b/client/src/components/media/MediaJobsQueue.jsx
index 2a72febfe1..d3e9d590eb 100644
--- a/client/src/components/media/MediaJobsQueue.jsx
+++ b/client/src/components/media/MediaJobsQueue.jsx
@@ -13,6 +13,18 @@ import { useAutoRefetch } from '../../hooks/useAutoRefetch';
import { useConfirmDelete } from '../../hooks/useConfirmDelete';
import useMounted from '../../hooks/useMounted';
import { formatTimeOfDaySeconds } from '../../utils/formatters';
+import { getVideoGenStatus } from '../../services/apiImageVideo.js';
+import { listLorasFull } from '../../services/api';
+import ModelSelect from '../ModelSelect';
+import ResolutionField from './ResolutionField';
+import AdvancedParamsPanel from '../videoGen/AdvancedParamsPanel';
+import { resolutionOptionsForModel } from '../../lib/videoGenResolutions';
+import {
+ videoEdgeBoundsForModel, textEncoderOptionsForModel, STOCK_TEXT_ENCODER_ID,
+ normalizeTextEncoderForModel,
+} from '../../lib/videoGenParams';
+import { loraFamilyOf, videoLoraFamily } from '../../lib/runnerFamilies';
+import LoraPicker from '../imageGen/LoraPicker';
const STATUS_BADGE = {
queued: 'bg-port-border text-port-text-muted',
@@ -472,16 +484,25 @@ function JobRow({ job, onCancel, onRetry, onRunNow, onDelete }) {
{job.startedAt && ` · started ${formatTimeOfDaySeconds(job.startedAt)}`}
{job.completedAt && ` · finished ${formatTimeOfDaySeconds(job.completedAt)}`}
</div>
- {editing && (
- <EditRetryForm
- job={job}
- onSubmit={(overrides) => {
- setEditing(false);
- onRetry(job.id, overrides);
- }}
- onCancel={() => setEditing(false)}
- />
- )}
+ {editing && (job.kind === 'video' ? (
+ <VideoRetryForm
+ job={job}
+ onSubmit={(overrides) => {
+ setEditing(false);
+ onRetry(job.id, overrides);
+ }}
+ onCancel={() => setEditing(false)}
+ />
+ ) : (
+ <EditRetryForm
+ job={job}
+ onSubmit={(overrides) => {
+ setEditing(false);
+ onRetry(job.id, overrides);
+ }}
+ onCancel={() => setEditing(false)}
+ />
+ ))}
</div>
);
}
@@ -638,3 +659,129 @@ function EditRetryForm({ job, onSubmit, onCancel }) {
</form>
);
}
+
+// The retry editor deliberately reuses the same resolution and advanced
+// controls rendered by VideoGen. Keeping the capability predicates in those
+// components means a newly-supported video knob is not silently absent here.
+function VideoRetryForm({ job, onSubmit, onCancel }) {
+ const p = job.params || {};
+ const [models, setModels] = useState([]);
+ const [modelId, setModelId] = useState(p.modelId || '');
+ const [prompt, setPrompt] = useState(p.prompt || '');
+ const [negativePrompt, setNegativePrompt] = useState(p.negativePrompt || '');
+ const [width, setWidth] = useState(p.width ?? '');
+ const [height, setHeight] = useState(p.height ?? '');
+ const [numFrames, setNumFrames] = useState(p.numFrames ?? 121);
+ const [fps, setFps] = useState(p.fps ?? 24);
+ const [chunks, setChunks] = useState(p.chunks ?? 1);
+ const [chunkPrompts, setChunkPrompts] = useState(p.chunkPrompts || []);
+ const [contextFrames, setContextFrames] = useState(p.contextFrames ?? 0);
+ const [seed, setSeed] = useState(p.seed ?? '');
+ const [steps, setSteps] = useState(p.steps ?? '');
+ const [guidanceScale, setGuidanceScale] = useState(p.guidanceScale ?? '');
+ const [imageStrength, setImageStrength] = useState(p.imageStrength ?? '');
+ const [tiling, setTiling] = useState(p.tiling || 'auto');
+ const [disableAudio, setDisableAudio] = useState(p.disableAudio === true);
+ const [textEncoderId, setTextEncoderId] = useState(p.textEncoderId || STOCK_TEXT_ENCODER_ID);
+ const [availableLoras, setAvailableLoras] = useState([]);
+ const [selectedLoras, setSelectedLoras] = useState(Array.isArray(p.loras) ? p.loras : []);
+
+ useEffect(() => {
+ getVideoGenStatus({ silent: true })
+ .then((status) => setModels(Array.isArray(status?.models) ? status.models : []))
+ .catch(() => {});
+ }, []);
+ useEffect(() => {
+ listLorasFull({ silent: true })
+ .then((loras) => setAvailableLoras(Array.isArray(loras) ? loras : []))
+ .catch(() => {});
+ }, []);
+
+ const currentModel = models.find((model) => model.id === modelId) || null;
+ const loraFamily = videoLoraFamily(currentModel);
+ const videoLoras = loraFamily ? availableLoras.filter((lora) => loraFamilyOf(lora) === loraFamily) : [];
+ const encoderOptions = textEncoderOptionsForModel(currentModel);
+ const originalEncoder = normalizeTextEncoderForModel(p.textEncoderId || STOCK_TEXT_ENCODER_ID, currentModel);
+ const setChunkPromptAt = (index, value) => setChunkPrompts((prev) => {
+ const next = [...prev];
+ next[index] = value;
+ return next;
+ });
+
+ const submit = (e) => {
+ e.preventDefault();
+ const overrides = {};
+ const textChanged = (value, original) => (value || '').trim() !== (original || '').trim();
+ const numberChanged = (value, original) => (value === '' ? null : Number(value)) !== (original ?? null);
+ if (!prompt.trim()) return;
+ if (textChanged(prompt, p.prompt)) overrides.prompt = prompt.trim();
+ if (textChanged(negativePrompt, p.negativePrompt)) overrides.negativePrompt = negativePrompt.trim();
+ if (textChanged(modelId, p.modelId)) overrides.modelId = modelId.trim();
+ if (numberChanged(width, p.width) && width !== '') overrides.width = Number(width);
+ if (numberChanged(height, p.height) && height !== '') overrides.height = Number(height);
+ if (numberChanged(numFrames, p.numFrames)) overrides.numFrames = Number(numFrames);
+ if (numberChanged(fps, p.fps)) overrides.fps = Number(fps);
+ if (numberChanged(chunks, p.chunks ?? 1)) overrides.chunks = Number(chunks);
+ if (JSON.stringify(chunkPrompts) !== JSON.stringify(p.chunkPrompts || [])) overrides.chunkPrompts = chunkPrompts;
+ if (numberChanged(contextFrames, p.contextFrames ?? 0)) overrides.contextFrames = Number(contextFrames);
+ if (numberChanged(seed, p.seed)) overrides.seed = Number(seed);
+ if (numberChanged(steps, p.steps)) overrides.steps = Number(steps);
+ if (numberChanged(guidanceScale, p.guidanceScale)) overrides.guidanceScale = Number(guidanceScale);
+ if (numberChanged(imageStrength, p.imageStrength)) overrides.imageStrength = Number(imageStrength);
+ if (tiling !== (p.tiling || 'auto')) overrides.tiling = tiling;
+ if (disableAudio !== (p.disableAudio === true)) overrides.disableAudio = disableAudio;
+ if (textEncoderId !== originalEncoder) overrides.textEncoderId = textEncoderId;
+ if (JSON.stringify(selectedLoras) !== JSON.stringify(p.loras || [])) overrides.loras = selectedLoras;
+ onSubmit(Object.keys(overrides).length ? overrides : null);
+ };
+
+ return (
+ <form onSubmit={submit} className="mt-3 pt-3 border-t border-port-border space-y-3">
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
+ <FormField label="Prompt" labelClassName="block text-xs font-medium text-gray-400 mb-1">
+ <textarea value={prompt} onChange={(e) => setPrompt(e.target.value)} rows={3} maxLength={8000} className="w-full bg-port-bg border border-port-border rounded-lg px-3 py-2 text-sm text-white" />
+ </FormField>
+ <FormField label="Negative Prompt" labelClassName="block text-xs font-medium text-gray-400 mb-1">
+ <textarea value={negativePrompt} onChange={(e) => setNegativePrompt(e.target.value)} rows={3} maxLength={8000} className="w-full bg-port-bg border border-port-border rounded-lg px-3 py-2 text-sm text-white" />
+ </FormField>
+ </div>
+ <div className="grid grid-cols-2 sm:grid-cols-3 gap-3">
+ <FormField className="col-span-2 sm:col-span-3" label="Model" labelClassName="block text-xs font-medium text-gray-400 mb-1">
+ {models.length > 0 ? <ModelSelect models={models} value={modelId} onChange={(e) => setModelId(e.target.value)} /> : (
+ <input value={modelId} onChange={(e) => setModelId(e.target.value)} className="w-full bg-port-bg border border-port-border rounded-lg px-2 py-2 text-sm text-white" />
+ )}
+ </FormField>
+ <ResolutionField presets={resolutionOptionsForModel(currentModel)} width={width} height={height} onChange={(w, h) => { setWidth(w); setHeight(h); }} {...videoEdgeBoundsForModel(currentModel)} snapOnBlur />
+ </div>
+ {encoderOptions.length > 1 && (
+ <FormField label="Text encoder" labelClassName="block text-xs font-medium text-gray-400 mb-1">
+ <ModelSelect models={encoderOptions} value={textEncoderId} onChange={(e) => setTextEncoderId(e.target.value)} getLabel={(option) => option.label} />
+ </FormField>
+ )}
+ {loraFamily && videoLoras.length > 0 && (
+ <LoraPicker
+ availableLoras={videoLoras}
+ selected={selectedLoras}
+ onChange={setSelectedLoras}
+ currentRunnerFamily={loraFamily}
+ currentCompatKey={loraFamily}
+ />
+ )}
+ <AdvancedParamsPanel
+ mode={p.mode || 'text'} currentModel={currentModel}
+ numFrames={numFrames} onNumFramesChange={setNumFrames}
+ chunks={chunks} onChunksChange={setChunks} keyframesActive={false}
+ chunkPrompts={chunkPrompts} onChunkPromptChange={setChunkPromptAt} chainingActive={chunks > 1}
+ contextFrames={contextFrames} onContextFramesChange={setContextFrames}
+ fps={fps} onFpsChange={setFps} seed={seed} onSeedChange={setSeed} onRandomSeed={() => setSeed(Math.floor(Math.random() * 2147483647))}
+ steps={steps} onStepsChange={setSteps} guidanceScale={guidanceScale} onGuidanceScaleChange={setGuidanceScale}
+ imageStrength={imageStrength} onImageStrengthChange={setImageStrength} tiling={tiling} onTilingChange={setTiling}
+ disableAudio={disableAudio} onDisableAudioChange={setDisableAudio} noMusic={false} onNoMusicChange={() => {}}
+ />
+ <div className="flex items-center justify-end gap-2 pt-1">
+ <button type="button" onClick={onCancel} className="px-3 py-1 text-xs text-port-text-muted hover:text-white">Cancel</button>
+ <button type="submit" className="inline-flex items-center gap-1 px-3 py-1 bg-port-accent text-white text-xs rounded hover:bg-port-accent/90"><RotateCw className="w-3 h-3" />Retry with changes</button>
+ </div>
+ </form>
+ );
+}
diff --git a/server/routes/mediaJobs.js b/server/routes/mediaJobs.js
index 3eacb051af..4f900b57a6 100644
--- a/server/routes/mediaJobs.js
+++ b/server/routes/mediaJobs.js
@@ -211,6 +211,14 @@ const RETRY_OVERRIDE_SCHEMA = z.object({
seed: z.number().int().optional(),
numFrames: z.number().int().min(1).max(2000).optional(),
fps: z.number().int().min(1).max(120).optional(),
+ tiling: z.enum(['auto', 'none', 'spatial', 'temporal']).optional(),
+ disableAudio: z.boolean().optional(),
+ imageStrength: z.number().min(0).max(1).optional(),
+ textEncoderId: z.string().max(64).optional().transform(emptyToUndef),
+ chunks: z.number().int().min(1).max(8).optional(),
+ chunkPrompts: z.array(z.string().max(8000)).max(8).optional(),
+ contextFrames: z.number().int().min(0).max(64).optional(),
+ loras: z.array(z.object({ filename: z.string().max(512), name: z.string().max(200).optional(), scale: z.number().min(0).max(2).optional() })).max(8).optional(),
}).partial();
const retryBodySchema = z.object({
diff --git a/server/routes/mediaJobs.test.js b/server/routes/mediaJobs.test.js
index e2da1c646c..72d3fc95f6 100644
--- a/server/routes/mediaJobs.test.js
+++ b/server/routes/mediaJobs.test.js
@@ -163,6 +163,33 @@ describe('mediaJobs routes', () => {
expect(call.params.steps).toBe(40);
});
+ it('POST /:id/retry accepts the editable video generation controls', async () => {
+ jobStore.set('j-video-edit', {
+ id: 'j-video-edit', kind: 'video', owner: null, status: 'failed',
+ params: { prompt: 'old', modelId: 'video-model', width: 768, height: 512 },
+ });
+ const r = await request(makeApp())
+ .post('/api/media-jobs/j-video-edit/retry')
+ .send({ params: {
+ prompt: 'new', negativePrompt: 'blur', modelId: 'other-model',
+ width: 1024, height: 576, numFrames: 121, fps: 24, steps: 25,
+ guidanceScale: 3, seed: 42, imageStrength: 0.5, tiling: 'spatial',
+ disableAudio: true, textEncoderId: 'stock', chunks: 2,
+ chunkPrompts: ['opening', 'climax'], contextFrames: 12,
+ } });
+ expect(r.status).toBe(200);
+ expect(stubs.enqueueJob).toHaveBeenCalledWith({
+ kind: 'video', owner: null,
+ params: {
+ prompt: 'new', negativePrompt: 'blur', modelId: 'other-model',
+ width: 1024, height: 576, numFrames: 121, fps: 24, steps: 25,
+ guidanceScale: 3, seed: 42, imageStrength: 0.5, tiling: 'spatial',
+ disableAudio: true, textEncoderId: 'stock', chunks: 2,
+ chunkPrompts: ['opening', 'climax'], contextFrames: 12,
+ },
+ });
+ });
+
it('GET /:id surfaces the Codex reasoning effort a job used (allowlisted)', async () => {
jobStore.set('j-eff', {
id: 'j-eff', kind: 'image', owner: null, status: 'failed',