Generate or edit images through Frevana's Gemini image endpoint using gemini-3-pro-image.
Return the validated API response JSON unchanged. Treat generated_images[0].image_url (or data[0].image_url) as the primary image URL.
Model Characteristics
- Uses
gemini-3-pro-image. - Best suited for production-ready creative, high-fidelity photorealism, fine text and texture rendering, complex compositions, and demanding reference-based editing.
- For rapid prototyping, fast iterations, or high-volume generation where lower latency is preferred, route to
gemini-3.1-flash-imageinstead.
What This Skill Needs
- user-provided
promptorcontents - optional reference image inputs:
--image,--image-url,--image-dir(up to 14 reference images, PNG/JPG/WebP, <50MB each) - optional image settings:
--aspect-ratio,--image-size,--candidate-count,--system-instruction,--seed - optional sampling settings (text-to-image only):
--temperature,--top-p,--top-k - optional async execution / deduplication:
--job-id - authentication:
FREVANA_API_KEY(or--api-key) /FREVANA_TOKEN(or--token) - optional attribution:
FREVANA_AGENT_APP_INSTANCE_ID(orX_FREVANA_AGENT_APP_INSTANCE_ID, or--agent-app-instance-id) sent asx-frevana-agent-app-instance-id curl,bash, andpython3
Execution Order
- Confirm the user supplied an image prompt.
- If the user provides local reference images, map them to repeatable
--image. - If the user provides remote reference URLs, map them to repeatable
--image-url. - If the user points to an image directory, map it to repeatable
--image-dir. - Enforce Gemini image editing rules:
- When reference images are present,
candidate_countsupports1only. - Text-to-image sampling parameters (
--temperature,--top-p,--top-k) are only allowed when no reference images are attached.
- When reference images are present,
- The script reads
FREVANA_API_KEY/FREVANA_TOKENfrom the environment, or CLI overrides--api-key/--token. - When
FREVANA_AGENT_APP_INSTANCE_IDis set, the script attaches it as thex-frevana-agent-app-instance-idheader. - Return raw JSON, or extract
generated_images[0].image_url(ordata[0].image_url) if the user only requested the URL. - Save JSON with
--outputwhen useful.
Allowed Options
--model:gemini-3-pro-image(default)--aspect-ratio:1:1,1:4,1:8,2:3,3:2,3:4,4:1,4:3,4:5,5:4,8:1,9:16,16:9,21:9--image-size:1K,2K,4K(defaults to1K)--candidate-count,--n:1-8(image editing supports1only)--system-instruction: system instruction prompt--temperature:0.0 - 2.0(text-to-image only)--top-p:0.0 - 1.0(text-to-image only)--top-k: integer>= 1(text-to-image only)--seed: random seed integer for reproducible results--job-id: client UUID for async generation and 7-day deduplication--image: repeatable local file path (.png,.jpg,.jpeg,.webp), under 50MB--image-url: repeatable remote HTTP(S) image; downloaded before upload, under 50MB--image-dir: repeatable local directory, recursively searched for images; up to 14 total reference images--api-key: Frevana API key override (sent asX-API-Key)--token: Frevana Bearer token override (sent asAuthorization: Bearer)--agent-app-instance-id: Agent App instance/team ID override (sent asx-frevana-agent-app-instance-id)--output: optional local path to save returned JSON
Commands
Text-to-Image Generation
bash <skill-path>/scripts/generate_image.sh \
--prompt "A masterpiece architectural photo of a modern glass pavilion in a misty forest at dawn" \
--aspect-ratio 16:9 \
--image-size 4K \
--candidate-count 1 \
--temperature 0.7 \
--output ./out/gemini-pro-result.json
Image Editing / Reference-to-Image
bash <skill-path>/scripts/generate_image.sh \
--prompt "Keep the product geometry and brand logo identical, but set it in a high-end luxury marble showroom" \
--image ./refs/watch.png \
--aspect-ratio 4:3 \
--image-size 2K \
--candidate-count 1 \
--output ./out/gemini-pro-edit-result.json
Response Shape
{
"generated_images": [
{
"image_url": "https://static.frevana.com/images/user-id/example-image-id.png",
"enhanced_prompt": "string",
"rai_filtered_reason": "string",
"mime_type": "image/png"
}
],
"credits_consumed": 1
}
Notes
- The backend route is
POST /gemini/image/generate. - Keep
promptrequired for both generation and editing. - Up to 14 reference images are supported across
--image,--image-url, and--image-dir. - When reference images are attached,
candidate_countmust be 1, and--temperature,--top-p,--top-kare rejected. - Do not rewrite or proxy returned Frevana image URLs unless requested.