Skip to content

Commit e32c685

Browse files
authored
Merge pull request #69 from timoncool/devin/1761547060-fix-runware-ideogram-parameters
Fix Runware API parameter compatibility for Ideogram models
2 parents 0e0c1f2 + d7e9a3b commit e32c685

4 files changed

Lines changed: 67 additions & 24 deletions

File tree

src/data/mutations.ts

Lines changed: 63 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,72 @@ export const useJobCreator = ({
7676
const taskUUID = crypto.randomUUID();
7777

7878
if (mediaType === "image") {
79-
const response = await runware.requestImages({
79+
const isIdeogram = endpointId.startsWith("ideogram:");
80+
81+
const imageParams: any = {
8082
positivePrompt: input.prompt || "",
8183
model: endpointId,
8284
height: input.height || 1024,
8385
width: input.width || 1024,
8486
numberResults: input.numberResults || 1,
8587
outputType: "URL" as const,
86-
outputFormat: input.outputFormat || "JPEG",
87-
checkNSFW: input.checkNSFW !== undefined ? input.checkNSFW : true,
88-
CFGScale: input.CFGScale || 3.5,
89-
steps: input.steps || 28,
90-
scheduler: input.scheduler || "Default",
88+
outputFormat: (input.outputFormat || "JPG") as "JPG" | "PNG" | "WEBP",
9189
includeCost:
9290
input.includeCost !== undefined ? input.includeCost : true,
93-
outputQuality: input.outputQuality || 85,
94-
...input,
95-
});
96-
97-
return {
98-
taskUUID,
99-
data: response,
10091
};
92+
93+
if (!isIdeogram) {
94+
imageParams.checkNSFW =
95+
input.checkNSFW !== undefined ? input.checkNSFW : true;
96+
imageParams.CFGScale = input.CFGScale || 3.5;
97+
imageParams.outputQuality = input.outputQuality || 85;
98+
99+
if (input.steps !== undefined) {
100+
imageParams.steps = input.steps;
101+
}
102+
}
103+
104+
console.log("[DEBUG] Runware requestImages - endpointId:", endpointId);
105+
console.log(
106+
"[DEBUG] Runware requestImages - params:",
107+
JSON.stringify(imageParams, null, 2),
108+
);
109+
110+
try {
111+
const response = await runware.requestImages(imageParams);
112+
console.log(
113+
"[DEBUG] Runware requestImages - SUCCESS:",
114+
JSON.stringify(response, null, 2),
115+
);
116+
117+
return {
118+
taskUUID,
119+
data: response,
120+
};
121+
} catch (error) {
122+
console.error("[DEBUG] Runware requestImages - ERROR:", error);
123+
console.error(
124+
"[DEBUG] Runware requestImages - ERROR message:",
125+
(error as any)?.message,
126+
);
127+
console.error(
128+
"[DEBUG] Runware requestImages - ERROR response:",
129+
(error as any)?.response,
130+
);
131+
console.error(
132+
"[DEBUG] Runware requestImages - ERROR response data:",
133+
(error as any)?.response?.data,
134+
);
135+
console.error(
136+
"[DEBUG] Runware requestImages - ERROR response status:",
137+
(error as any)?.response?.status,
138+
);
139+
console.error(
140+
"[DEBUG] Runware requestImages - ERROR stringified:",
141+
JSON.stringify(error, null, 2),
142+
);
143+
throw error;
144+
}
101145
}
102146
if (mediaType === "video") {
103147
const runware = await getRunwareClient();
@@ -143,22 +187,20 @@ export const useJobCreator = ({
143187
model: endpointId,
144188
duration: input.duration || 30,
145189
outputFormat: "MP3" as const,
190+
outputType: "URL" as const,
146191
audioSettings: {
147192
bitrate: 128,
148193
sampleRate: 44100,
149194
},
150195
};
151196

152-
console.log("[DEBUG] Calling runware.audioInference with:", {
153-
...audioParams,
154-
outputType: ["URL"],
155-
});
197+
console.log(
198+
"[DEBUG] Calling runware.audioInference with:",
199+
audioParams,
200+
);
156201

157202
try {
158-
const response = await runware.audioInference({
159-
...audioParams,
160-
outputType: ["URL"] as any,
161-
});
203+
const response = await runware.audioInference(audioParams);
162204
console.log("[DEBUG] audioInference response:", response);
163205
console.log(
164206
"[DEBUG] audioInference response stringified:",

src/lib/fal.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ export const AVAILABLE_ENDPOINTS: ApiInfo[] = [
278278
provider: "fal",
279279
endpointId: "fal-ai/veo2/image-to-video",
280280
label: "Veo 2 Image-to-Video",
281-
description: "Veo 2 dedicated image-to-video endpoint with enhanced quality",
281+
description:
282+
"Veo 2 dedicated image-to-video endpoint with enhanced quality",
282283
cost: "$0.50/sec",
283284
popularity: 4,
284285
category: "video",

tools/docs-scraper/manifest_fal.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,4 @@
212212
}
213213
},
214214
"last_updated": "2025-10-27 03:52:36"
215-
}
215+
}

tools/docs-scraper/manifest_runware.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,4 @@
310310
}
311311
},
312312
"last_updated": "2025-10-27 03:51:56"
313-
}
313+
}

0 commit comments

Comments
 (0)