Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Restore 12: Then upscale is read from the address once, not set in an effect

Claudeb287ce3ac6b8
diff --git a/src/components/restore/restore-tool.tsx b/src/components/restore/restore-tool.tsx
index ad5dc688..eb2f3a10 100644
--- a/src/components/restore/restore-tool.tsx
+++ b/src/components/restore/restore-tool.tsx
@@ -56,7 +56,8 @@ export function RestoreTool({ tabs }: { tabs?: React.ReactNode }) {
const [refine, setRefine] = useState(false);
const [deinterlace, setDeinterlace] = useState(false);
// Upscale → "Restore archive footage first" arrives with ?then=upscale: the upscale runs after, as one job.
- const [upscale, setUpscale] = useState(false);
+ // (Read once: the switch shows only once a clip is in, after the first render, so server and browser agree.)
+ const [upscale, setUpscale] = useState(() => typeof window !== "undefined" && new URLSearchParams(window.location.search).get("then") === THEN_UPSCALE);
const [reference, setReference] = useState<SlotValue | null>(null);
const [resolution, setResolution] = useState<string>(RESTORE.cloudResolution);
const [run, setRun] = useState<Run | null>(null);
@@ -67,10 +68,8 @@ export function RestoreTool({ tabs }: { tabs?: React.ReactNode }) {
// Hand-off: /video-tools/restore?video=/api/files/… (a result, a Library clip, Upscale's link).
useEffect(() => {
- const q = new URLSearchParams(window.location.search);
- const video = q.get("video");
+ const video = new URLSearchParams(window.location.search).get("video");
if (video?.startsWith("/api/files/")) source.adopt(video, video.split("/").pop());
- if (q.get("then") === THEN_UPSCALE) setUpscale(true);
// Once, on arrival.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);