Skip to content

Commit d5f425c

Browse files
committed
Change default hosts and delays in simulation
Add .gemini/settings.json to allow run_shell_command. Bump @types/node to 24.9.2 and update WorkflowPool @SInCE tags to 1.5.0. Minor formatting and chaining cleanups in scripts/two-stage-edit-simulation.ts
1 parent 1fe73eb commit d5f425c

4 files changed

Lines changed: 24 additions & 19 deletions

File tree

.gemini/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tools": {
3+
"allowed": ["run_shell_command"]
4+
}
5+
}

dist/pool/WorkflowPool.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export interface WorkflowPoolOpts {
5959
* executionStartTimeoutMs: 10000 // 10 seconds
6060
* });
6161
* ```
62-
* @since 1.4.4
62+
* @since 1.5.0
6363
*/
6464
executionStartTimeoutMs?: number;
6565
/**
@@ -90,7 +90,7 @@ export interface WorkflowPoolOpts {
9090
* - Progress events (e.g., KSampler steps) reset the timeout
9191
* - First generation with model loading often needs longer timeout
9292
* - Cached nodes complete instantly and don't trigger timeout
93-
* @since 1.4.4
93+
* @since 1.5.0
9494
*/
9595
nodeExecutionTimeoutMs?: number;
9696
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"devDependencies": {
6363
"@types/bun": "^1.3.1",
6464
"@types/jest": "^30.0.0",
65-
"@types/node": "24.9.1",
65+
"@types/node": "24.9.2",
6666
"@types/ws": "^8.18.1",
6767
"cross-env": "^10.1.0",
6868
"@istanbuljs/schema": "^0.1.3",

scripts/two-stage-edit-simulation.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ import { delay } from "../src/tools.ts";
1515
*/
1616

1717
const DEFAULT_HOSTS = [
18-
"http://localhost:8188",
18+
"http://afterpic-comfy-igor:8188",
1919
"http://afterpic-comfy-aero16:8188",
2020
"http://afterpic-comfy-domi:8188"
2121
];
2222

2323
const hosts = process.env.TWO_STAGE_HOSTS
24-
? process.env.TWO_STAGE_HOSTS.split(",").map((h) => h.trim()).filter(Boolean)
24+
? process.env.TWO_STAGE_HOSTS.split(",")
25+
.map((h) => h.trim())
26+
.filter(Boolean)
2527
: DEFAULT_HOSTS;
2628

2729
if (hosts.length === 0) {
@@ -35,11 +37,11 @@ const runtimeMs = Number.isFinite(Number(process.env.TWO_STAGE_RUNTIME_MS))
3537

3638
let minDelayMs = Number.isFinite(Number(process.env.TWO_STAGE_MIN_DELAY_MS))
3739
? Number(process.env.TWO_STAGE_MIN_DELAY_MS)
38-
: 30_000; // 30 seconds
40+
: 5_000; // 5 seconds
3941

4042
let maxDelayMs = Number.isFinite(Number(process.env.TWO_STAGE_MAX_DELAY_MS))
4143
? Number(process.env.TWO_STAGE_MAX_DELAY_MS)
42-
: 4 * 60_000; // 4 minutes
44+
: 1 * 60_000; // 4 minutes
4345

4446
if (minDelayMs > maxDelayMs) {
4547
console.warn(`Swapping min/max delay: ${minDelayMs} > ${maxDelayMs}`);
@@ -121,8 +123,7 @@ function clone<T>(obj: T): T {
121123

122124
function buildGenerationWorkflow(prompt: string, negative: string, seed: number) {
123125
const wf = Workflow.from(clone(GenerationGraph));
124-
wf
125-
.set("1.inputs.value", prompt)
126+
wf.set("1.inputs.value", prompt)
126127
.set("2.inputs.value", negative)
127128
.set("10.inputs.seed", seed)
128129
.output("base_preview", "12");
@@ -131,11 +132,7 @@ function buildGenerationWorkflow(prompt: string, negative: string, seed: number)
131132

132133
function buildEditWorkflow(imageName: string, editPrompt: string, seed: number) {
133134
const wf = Workflow.from(clone(EditGraph));
134-
wf
135-
.set("91.inputs.prompt", editPrompt)
136-
.set("51.inputs.seed", seed)
137-
.set("97.inputs.image", imageName)
138-
.output("207");
135+
wf.set("91.inputs.prompt", editPrompt).set("51.inputs.seed", seed).set("97.inputs.image", imageName).output("207");
139136
return wf;
140137
}
141138

@@ -225,10 +222,10 @@ async function main() {
225222
const records = Array.isArray(preview?.images)
226223
? preview.images
227224
: Array.isArray(preview)
228-
? preview
229-
: preview
230-
? [preview]
231-
: [];
225+
? preview
226+
: preview
227+
? [preview]
228+
: [];
232229
if (!records.length) {
233230
throw new Error("Generation workflow returned no images");
234231
}
@@ -314,7 +311,10 @@ async function main() {
314311
}
315312
}
316313

317-
log("Two-stage simulation complete", stats.map(({ client, ...rest }) => rest));
314+
log(
315+
"Two-stage simulation complete",
316+
stats.map(({ client, ...rest }) => rest)
317+
);
318318
const totalFailures = stats.reduce((sum, s) => sum + s.failures, 0);
319319
const totalDisconnects = stats.reduce((sum, s) => sum + s.disconnects, 0);
320320

0 commit comments

Comments
 (0)