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.

Studio: one Run with your key press at a time for a waiting batch, from any of its tiles

Adarsh3b27037340b3
diff --git a/src/lib/run-trouble.ts b/src/lib/run-trouble.ts
index 5914304e..810ea34a 100644
--- a/src/lib/run-trouble.ts
+++ b/src/lib/run-trouble.ts
@@ -143,8 +143,8 @@ export function waitingRunHandlers(g: Generation, d: RunTroubleDeps): RunTrouble
const key = batchKeyOf(g);
return {
onRunWithKey: async (a) => {
- const was = moving.get(key);
- if (was && was !== g.id) return false;
+ // One press at a time for a batch (a run's several pending tiles share it too).
+ if (moving.has(key)) return false;
setMoving(key, g.id);
const started = await d.run({ ...onCloudKey(g.request, a), replaces: g.id } as Generation["request"]);
// Started: the batch's jobs stop, so their tiles go. Refused: the button comes back.
diff --git a/tests/own-graceful-ui.test.ts b/tests/own-graceful-ui.test.ts
index 608de29b..57a2d0be 100644
--- a/tests/own-graceful-ui.test.ts
+++ b/tests/own-graceful-ui.test.ts
@@ -232,6 +232,8 @@ describe("a run's buttons, in a studio and in the Library", () => {
const html = render(createElement(RunTroubleActions, { g: other, actions: [withKeyAction("fal", "minimax-h3", "i2v"), { kind: "check-gpu", label: "Check my GPU" }] }));
expect(html).not.toContain("Run with your fal.ai key");
await waitingRunHandlers(other, { run, onError: vi.fn() }).onRunWithKey!(withKeyAction("fal", "minimax-h3", "i2v"));
+ // Nor does another of the same run's pending tiles.
+ await waitingRunHandlers(waiting, { run, onError: vi.fn() }).onRunWithKey!(withKeyAction("fal", "minimax-h3", "i2v"));
expect(sent).toHaveLength(1);
// Refused: the button comes back.
release(false);