diff --git a/src/components/models/code/Flux-1-Schnell.astro b/src/components/models/code/Flux-1-Schnell.astro index fbc42e1a234ace..bb68c05d821c8b 100644 --- a/src/components/models/code/Flux-1-Schnell.astro +++ b/src/components/models/code/Flux-1-Schnell.astro @@ -20,6 +20,7 @@ export default { async fetch(request, env): Promise { const response = await env.AI.run('@cf/black-forest-labs/flux-1-schnell', { prompt: 'a cyberpunk lizard', + seed: Math.floor(Math.random() * 10) }); // response.image is base64 encoded which can be used directly as an data URI const dataURI = \`data:image/jpeg;charset=utf-8;base64,\${response.image}\`; @@ -38,6 +39,7 @@ export default { async fetch(request, env): Promise { const response = await env.AI.run('@cf/black-forest-labs/flux-1-schnell', { prompt: 'a cyberpunk lizard', + seed: Math.floor(Math.random() * 10) }); // Convert from base64 string const binaryString = atob(response.image); @@ -56,7 +58,7 @@ const curl = ` curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/${name} \\ -X POST \\ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \\ - -d '{ "prompt": "cyberpunk cat" }' + -d '{ "prompt": "cyberpunk cat", "seed": "Random positive integer" }' `; ---