HiggsfieldMCP / tools /generate_image.md
StarpowerTechnology's picture
Upload 333 files
7f635f8 verified
|
Raw History Blame Contribute Delete
9.88 kB

Generate an image. A successful submission returns job IDs; a choice or rejected request submits no job. For credit preflight use estimate_image_cost first; HTTPS image references are imported into your media library. Call this directly as the first tool call of the turn with the default model gpt_image_2_6 for ordinary generation, photorealistic images, typography, and reference-based editing. GPT Image 2.6 (Sunburst) and gpt_image_2_6_flare support native animated GIF and SVG output: set output_format to gif or svg among the model-specific params. For a GIF request use this image tool directly, not video generation or conversion. GIF accepts references and live size/frame_count/frame_duration_ms controls; SVG is generation-only without references. Preserve explicit model choices. Consult models_recommend, models_search, models_list, or models_get only when the user asks to pick or compare models, or you need aspect_ratios, parameters, or medias[].roles for reference inputs. Reference media can be uploaded media UUIDs from media_upload_and_confirm, completed generation job UUIDs, or authorized HTTPS image URLs such as user-provided file download URLs; the server imports HTTPS images into Higgsfield and confirms them automatically. For a specific already-trained Soul character, first call soul_list with the matching type and status='ready', then pass its returned soul_id with the matching Soul model. Reference Element IDs are not Soul IDs. If the required character cannot be resolved or generation rejects it, stop; never omit soul_id or substitute another identity without the user's agreement. For other character/avatar requests use image generation directly; there is no reusable character-training flow here. All arguments go inside the single params object — params.model is required, params.prompt holds the text description, and model-specific parameters are additional keys of params. Server returns adjustments for fallbacks; invalid declared-param values return a structured error. This tool already displays its submitted jobs in an auto-updating generation widget, including while pending or in progress. Do not follow it with job_display, show_generations, or show_generation_by_ids merely to show or refresh the same results, before or after completion. To await completion, use jobs_wait with timeout_seconds <= 15; it does not open another widget. Use a separate display only when the user explicitly requests one or the workflow requires a distinct preview or approval. Headless generate_*_batch and execute_preset workflows follow their own display instructions. On a transport timeout the submission outcome may be unknown: do not automatically resubmit. Reuse returned job IDs and retry only after the original outcome is known.

mcp__Higgsfield__generate_image(args: {
// Briefly describe the user's underlying goal and why this call helps, in one short sentence. Do not include names, contact details, credentials, URLs, or biometric details. Analytics only; not a generation prompt.
context?: string, // maxLength: 500
params: {
// Output aspect ratio: 'auto' or positive width:height, for example '1:1', '9:16', or '16:9'. Omit for the selected model's default. Use models_get to inspect that model's supported values; the server coerces unsupported well-formed ratios when a safe model fallback exists.
aspect_ratio?: string, // pattern: /^(?:auto|[1-9]\d*:[1-9]\d*)$/
// Number of results (1-4). Ignored with use_unlim: an unlim request is always one generation — count is capped to 1 and the cap comes back in adjustments. Send separate calls for more.
count?: integer, // default: 1, minimum: 1, maximum: 4
// Destination folder for this conversation. Use default_folder_id from create_project, or folder_id from create_folder when requested. Reuse on every generation and batch item in this conversation; never invent an ID or share a destination across chats. Omit by default for generation without a project. Before the first generation without a destination, call get_preferences: create a project only when auto_create_project is true or explicitly requested. Explicit existing destinations and requests to work without a project take priority; never change the saved preference for a one-off request.
folder_id?: string, // pattern: /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, format: "uuid"
// Reference media inputs.
medias?: Array<
{
// Canonical reference role. Allowed: 'image' — Generic reference image (style, composition, subject). | 'start_image' — First frame of the output video. | 'end_image' — Last frame of the output video. | 'video' — Reference video clip. | 'audio' — Reference audio clip. | 'ref_element' — Named element to preserve across frames (product, character). The selected model may support only a subset; use models_get to inspect it. The server maps canonical roles to model-specific backend media keys when needed.
role: "image" | "start_image" | "end_image" | "video" | "audio" | "ref_element",
// Uploaded media UUID from media_upload_and_confirm, completed generation job UUID, or authorized HTTPS image URL. HTTPS image URLs are imported and confirmed automatically.
value: string,
}
>,
// Model ID from the model catalog (required).
model: string,
// Session returned by start_katana_preset_session for every Katana preset run, paid or free. Forward this ID on every generation and batch item in that run, including cost estimates. Add use_free_gens: true only when the user explicitly requests free generations; otherwise omit it.
preset_session_id?: string, // minLength: 1, maxLength: 64, pattern: /^[A-Za-z0-9_-]+$/
// Text description of what to generate.
prompt?: string,
// Request free generation only when the user explicitly asks. For a Katana run, also pass preset_session_id from start_katana_preset_session; the backend validates eligibility. Do not combine with use_unlim or retry a rejected free request on credits without explicit approval. true caps count to 1.
use_free_gens?: boolean,
// Which balance pays for this generation: the caller's free-trial unlimited generations (true) or their credits (false). OMIT IT to let the server decide — if they hold an allowance that covers the model, the tool submits nothing and returns `unlim_choice` for the user to answer; call again with the same params plus this field. true also caps count to 1.
use_unlim?: boolean,
[key: string]: any,
},
}): Promise<{
// Additional JSON Schema constraints: propertyNames={"type": "string"}
adjustments?: { [key: string]: { reason: string, requested: string | number | boolean, used: string | number | boolean } },
// Set when the server auto-picked an avatar because product_ids were passed without avatars/avatar_ids (Marketing Studio video).
avatar_auto_picked?: { id: string, name?: string, type: "preset" | "custom" },
// Live brand kit status when a generation was rejected because the kit is not ready yet.
brand_kit_status?: string,
error?: string,
// Suggested follow-up tool call attached to a recoverable request error.
next_step?: {
// Additional JSON Schema constraints: propertyNames={"type": "string"}
params: { [key: string]: any },
tool: string,
},
results?: Array<
{
author?: {
avatarUrl?: string,
userId: string, // minLength: 1
username?: string,
},
batch_id?: string,
createdAt?: number,
folder_id?: string, // pattern: /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, format: "uuid"
id: string, // minLength: 1
liked?: boolean,
model: string,
params: {
aspect_ratio?: string | null,
custom_reference_id?: (string | { [key: string]: any }) | null,
duration?: number | null,
image?: string | null,
input_images?: { id?: string, type?: string, url?: string, [key: string]: any }[] | null,
medias?: { data?: { id?: string, type?: string, url?: string, [key: string]: any }, role?: string, [key: string]: any }[] | null,
presetMeta?: { id?: string, name?: string, url?: string } | null,
prompt: string, // default: ""
reference_images?: Array<string | { [key: string]: any }> | null,
soul_id?: (string | { [key: string]: any }) | null,
soul_reference?: { name?: string, preview_url?: string, soul_id: string, thumbnail_url?: string, url?: string } | null,
voice?: (string | { id?: string, name?: string, type?: string, [key: string]: any }) | null,
[key: string]: any,
},
results?: {
autosprite?: { atlasUrl?: string, audioUrl?: string, columns?: number, frameCount?: number, frameHeight?: number, frameWidth?: number, spritesheetId?: string },
durationSec?: number,
// Original EXR ZIP; when present, rawUrl is the unprocessed input video used for playback.
exrUrl?: string,
height?: number,
minUrl?: string,
previewSource?: "input" | "result",
rawUrl: string,
text?: string,
thumbnailUrl?: string,
vtt?: string,
waveformUrl?: string,
width?: number,
},
status: "pending" | "waiting" | "queued" | "dna" | "script" | "visuals" | "vision" | "flow" | "in_progress" | "ip_detect" | "completed" | "canceled" | "failed" | "nsfw" | "ip_detected",
type: "image" | "video" | "audio" | "3d",
}
>,
// NO JOB WAS SUBMITTED. The caller has free unlimited generations that cover this model, and nobody has said whether to spend them. Ask the user, then call the same tool again with use_unlim: true (free) or use_unlim: false (credits). Do not pick for them.
unlim_choice?: {
// ISO timestamp when the allowance lapses.
expires_at?: string | null,
// The question to put to the user, verbatim.
message: string,
// Model the choice applies to.
model: string,
// Unlimited generations left; null means unmetered.
remaining?: number | null,
},
warning?: string,
}>;