|
Download tools/create_reference_element.md from StarpowerTechnology/HiggsfieldMCP: direct link, hf CLI and curl.
- Browser
- Download file 5.07 kB
-
https://huggingface.co/datasets/StarpowerTechnology/HiggsfieldMCP/resolve/main/tools/create_reference_element.md
- Command line
-
hf download hf://datasets/StarpowerTechnology/HiggsfieldMCP/tools/create_reference_element.md
-
curl -L -o create_reference_element.md https://huggingface.co/datasets/StarpowerTechnology/HiggsfieldMCP/resolve/main/tools/create_reference_element.md
5.07 kB
| Create one reusable character, environment or prop in the selected workspace from confirmed images. Upload first via media_upload_and_confirm. Omit name to derive it from media; category defaults to auto. Returns the created element and refreshes the gallery. USAGE IN GENERATION: | |
| Embed `<<<element_id>>>` inside `params.prompt` of `generate_image` / `generate_video`. Backend auto-injects the image and rewrites to `@element_name`. Multiple placeholders per prompt OK. | |
| Example: `"Cinematic portrait of <<<UUID>>> on a rooftop"`, `"<<<A>>> handing coffee to <<<B>>> in a Paris cafe"`. | |
| SUPPORTED MODELS (`params.model` = machine name, friendly in parens): | |
| - Image: `gpt_image_2_6` (GPT Image 2.6 Sunburst), `gpt_image_2_6_flare` (GPT Image 2.6 Flare), `nano_banana_pro` (Nano Banana Pro), `nano_banana_2` (Nano Banana 2), `gpt_image_2` (GPT Image 2), `seedream_v4_5` (Seedream 4.5), `seedream_v5_lite` (Seedream 5.0 lite), `cinematic_studio_2_5` (Cinema Studio Image 2.5). | |
| - Video: `cinematic_studio_video_v2` (Cinema Studio Video 2), `cinematic_studio_3_0` (Cinema Studio Video 3.0), `seedance_2_0` (Seedance 2.0), `kling3_0` (Kling 3.0 — REQUIRES a `start_image` in `params.medias`; element placeholder alone won't trigger reference usage). | |
| Map friendly names to model ids. Verify reference-element support before choosing other models. GPT Image 2.6 supports element references for raster and GIF output; SVG accepts no elements or image references. | |
| USER-FACING STYLE: prefer friendly model names and element names for readability. | |
| GUARDS: | |
| - `@name` form does NOT work in tool calls — only `<<<UUID>>>` in `params.prompt`. | |
| - Do NOT put element ids in `params.medias` / `params.input_images` — placeholder handles injection. | |
| - `kling3_0` only honors reference elements when an explicit `start_image` is provided in `params.medias`. If the user wants Kling 3.0 with an element but hasn't supplied a start frame, ask for one (upload via media_upload_and_confirm, or pick a prior generation) before calling `generate_video`. Without a start_image, pick another video model from the list. | |
| - Only `status: completed` elements are usable; skip `processing` / `ip_checking` / `failed` / `kling_failed` / `nsfw`. | |
| ```ts | |
| mcp__Higgsfield__create_reference_element(args: { | |
| // Defaults to auto classification; use a specific category only when requested. | |
| category?: "auto" | "character" | "environment" | "prop", | |
| // Optional description stored with the element. | |
| description?: string, | |
| // Confirmed image references. Upload first via media_upload_and_confirm. | |
| // minItems: 1 | |
| medias: Array< | |
| { | |
| // media_input UUID returned by media_upload_and_confirm, or completed image_job UUID. | |
| id: string, | |
| // Source kind for `id`. Defaults to `media_input`. | |
| type?: "media_input" | "image_job", // default: "media_input" | |
| // https media URL of the asset, normally a Higgsfield upload URL (e.g. https://upload.higgsfield.ai/user_<id>/<uuid>.png). Must be https; private/loopback hosts are rejected. | |
| url: string, | |
| } | |
| >, | |
| // Element name, max 32 characters; omit to derive from media. | |
| name?: string, // maxLength: 32 | |
| }): Promise<{ | |
| // The created reference element. | |
| element?: { | |
| // Reference element category. Known values: `character`, `environment`, `prop`, `character_ip_verified`, `environment_ip_verified`. | |
| category: string, | |
| created_at: number, | |
| description: string | null, | |
| id: string, | |
| // Image medias. List view returns only the first media; fetch via `action=get` with `element_id` to get the full list. | |
| medias: Array< | |
| { | |
| id: string, | |
| // Media kind. Known values: `media_input`, `image_job`. | |
| type: string, | |
| url: string, | |
| } | |
| >, | |
| name: string, | |
| // Element status. Known values: `processing`, `ip_checking`, `completed`, `nsfw`, `kling_failed`, `failed`. | |
| status: string, | |
| // Video medias. List view returns only the first media; fetch via `action=get` with `element_id` to get the full list. | |
| video_medias: Array< | |
| { | |
| id: string, | |
| // Media kind. Known values: `media_input`, `image_job`. | |
| type: string, | |
| url: string, | |
| } | |
| >, | |
| }, | |
| error?: string, | |
| // Reference elements. Single-element when `action=get`, otherwise the page from `action=list`. | |
| items?: Array< | |
| { | |
| // Reference element category. Known values: `character`, `environment`, `prop`, `character_ip_verified`, `environment_ip_verified`. | |
| category: string, | |
| created_at: number, | |
| description: string | null, | |
| id: string, | |
| // Image medias. List view returns only the first media; fetch via `action=get` with `element_id` to get the full list. | |
| medias: Array< | |
| { | |
| id: string, | |
| // Media kind. Known values: `media_input`, `image_job`. | |
| type: string, | |
| url: string, | |
| } | |
| >, | |
| name: string, | |
| // Element status. Known values: `processing`, `ip_checking`, `completed`, `nsfw`, `kling_failed`, `failed`. | |
| status: string, | |
| // Video medias. List view returns only the first media; fetch via `action=get` with `element_id` to get the full list. | |
| video_medias: Array< | |
| { | |
| id: string, | |
| // Media kind. Known values: `media_input`, `image_job`. | |
| type: string, | |
| url: string, | |
| } | |
| >, | |
| } | |
| >, | |
| // [action=list] Pass as `cursor` to fetch the next page. Null when no more pages. | |
| next_cursor?: number | null, | |
| }>; | |
| ``` |