MCPcopy Create free account
hub / github.com/pollinations/pollinations / generateImageResult

Function generateImageResult

gen.pollinations.ai/src/image/handler.ts:351–370  ·  view source on GitHub ↗
(
    c: ImageContext,
    originalPrompt: string,
    safeParams: ImageParams,
)

Source from the content-addressed store, hash-verified

349}
350
351async function generateImageResult(
352 c: ImageContext,
353 originalPrompt: string,
354 safeParams: ImageParams,
355): Promise<ImageGenerationResult> {
356 const prompt = sanitizeString(String(originalPrompt));
357
358 const result = await createAndReturnImageCached(
359 prompt,
360 safeParams,
361 originalPrompt,
362 createAuthResult(c),
363 );
364
365 if (result.isChild && result.isMature) {
366 await sleep(5000);
367 }
368
369 return result;
370}
371
372async function generateVideoResult(
373 c: ImageContext,

Callers 1

Calls 4

sanitizeStringFunction · 0.90
sleepFunction · 0.90
createAuthResultFunction · 0.85

Tested by

no test coverage detected