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

refactor([unify-videogen-resolutions-with-shared-image-gen]): extract VideoGen RESOLUTIONS to shared lib

[._.]/ Adam Eivy501000a4ac62
diff --git a/client/src/lib/README.md b/client/src/lib/README.md
index dc7060eabb..04f2a71fbe 100644
--- a/client/src/lib/README.md
+++ b/client/src/lib/README.md
@@ -41,6 +41,7 @@ grep -i "what you want to do" client/src/lib/README.md
| `wrImageDefaults.js` | Writers Room per-scene image-gen defaults + style discriminators. |
| `imageGenBackends.js` | `IMAGE_GEN_MODE` enum (local / codex / external) + metadata. |
| `imageGenResolutions.js` | Shared resolution presets for image generation. |
+| `videoGenResolutions.js` | Shared resolution presets for video generation (companion to image side; LTX-2 latent-friendly sizes). |
## Graph & sim
diff --git a/client/src/lib/index.js b/client/src/lib/index.js
index cd603165af..b16de47734 100644
--- a/client/src/lib/index.js
+++ b/client/src/lib/index.js
@@ -17,6 +17,7 @@ export * from './imageGenResolutions.js';
export * from './issueLength.js';
export * from './pipelineImageDefaults.js';
export * from './runnerFamilies.js';
+export * from './videoGenResolutions.js';
export * from './wrImageDefaults.js';
// === Graph & sim ===
diff --git a/client/src/lib/videoGenResolutions.js b/client/src/lib/videoGenResolutions.js
new file mode 100644
index 0000000000..26db46cfb6
--- /dev/null
+++ b/client/src/lib/videoGenResolutions.js
@@ -0,0 +1,17 @@
+// Shared resolution presets for video generation. Companion to
+// `imageGenResolutions.js` — both pages drive a "preset dropdown + custom
+// fallback" pattern off these tables so the size dropdown stays consistent.
+//
+// Video sizes follow LTX-2's preferred latent boundaries (multiples of 32 on
+// each edge); the aspect-ratio hints in the labels surface common shapes the
+// user picks for (16:9 social, 9:16 mobile, 1:1 grid).
+export const VIDEO_RESOLUTIONS = [
+ { label: '512×320 (16:10)', w: 512, h: 320 },
+ { label: '640×384 (5:3)', w: 640, h: 384 },
+ { label: '704×448 (16:10)', w: 704, h: 448 },
+ { label: '768×512 (3:2 default)', w: 768, h: 512 },
+ { label: '1024×576 (16:9)', w: 1024, h: 576 },
+ { label: '512×768 (portrait)', w: 512, h: 768 },
+ { label: '512×512 (1:1)', w: 512, h: 512 },
+ { label: '768×768 (1:1)', w: 768, h: 768 },
+];
diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsx
index c30f4a8cf0..419fd9e3d4 100644
--- a/client/src/pages/VideoGen.jsx
+++ b/client/src/pages/VideoGen.jsx
@@ -53,17 +53,7 @@ import {
listImageGallery,
} from '../services/api';
import { randomSeed, safeParseJSON } from '../lib/genUtils';
-
-const RESOLUTIONS = [
- { label: '512×320 (16:10)', w: 512, h: 320 },
- { label: '640×384 (5:3)', w: 640, h: 384 },
- { label: '704×448 (16:10)', w: 704, h: 448 },
- { label: '768×512 (3:2 default)', w: 768, h: 512 },
- { label: '1024×576 (16:9)', w: 1024, h: 576 },
- { label: '512×768 (portrait)', w: 512, h: 768 },
- { label: '512×512 (1:1)', w: 512, h: 512 },
- { label: '768×768 (1:1)', w: 768, h: 768 },
-];
+import { VIDEO_RESOLUTIONS } from '../lib/videoGenResolutions';
// Values follow LTX-2's 8k+1 latent boundary so the model doesn't silently
// snap. 241 = 10s @ 24fps is the comfortable single-pass ceiling on 48 GB
@@ -325,12 +315,12 @@ export default function VideoGen() {
}, [refreshStatus]);
const currentModel = models.find((m) => m.id === modelId);
- const matchedResolution = RESOLUTIONS.find((r) => r.w === width && r.h === height);
+ const matchedResolution = VIDEO_RESOLUTIONS.find((r) => r.w === width && r.h === height);
const resolutionLabel = matchedResolution?.label || `${width}×${height}`;
const progressPct = progress?.progress != null ? Math.round(progress.progress * 100) : null;
const handleResolutionChange = (e) => {
- const r = RESOLUTIONS.find((r) => r.label === e.target.value);
+ const r = VIDEO_RESOLUTIONS.find((r) => r.label === e.target.value);
if (r) { setWidth(r.w); setHeight(r.h); }
};
const handleRandomSeed = () => setSeed(randomSeed());
@@ -1051,7 +1041,7 @@ export default function VideoGen() {
{!matchedResolution && (
<option value={resolutionLabel}>{`${width}×${height} (custom)`}</option>
)}
- {RESOLUTIONS.map((r) => <option key={r.label} value={r.label}>{r.label}</option>)}
+ {VIDEO_RESOLUTIONS.map((r) => <option key={r.label} value={r.label}>{r.label}</option>)}
</select>
</div>