feat(engine): add opt-in image timeout and scene-paint hedging
IMAGE_TIMEOUT_MS sets a per-attempt hard deadline (AbortSignal.timeout); IMAGE_HEDGE_MS races a second identical scene-paint request when the first is still pending past the threshold. Both default to OFF when unset, preserving historical behavior for self-hosted deploys. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -87,7 +87,12 @@ export async function renderCharacterPortrait(
|
||||
visualDescription,
|
||||
styleGuide,
|
||||
);
|
||||
const { imageUrl, imageUuid } = await generateImage(config.image, prompt);
|
||||
// Portraits get the hard timeout but are never hedged — a scene already
|
||||
// runs several portrait paints in parallel, and hedging those would push
|
||||
// burst concurrency past Runware's recommended 2-4 in-flight requests.
|
||||
const { imageUrl, imageUuid } = await generateImage(config.image, prompt, {
|
||||
timeoutMs: config.imageTimeoutMs,
|
||||
});
|
||||
return { basePortraitUrl: imageUrl, basePortraitUuid: imageUuid };
|
||||
} catch (err) {
|
||||
const msg = err instanceof Error ? err.message : String(err);
|
||||
|
||||
Reference in New Issue
Block a user