Explore/Ideogram 4.0
Image

Ideogram 4.0

Generates and edits images with multilingual text for posters, packaging and other graphic layouts.

View docs
import { config, higgsfield } from "@higgsfield/client/v2";config({  credentials: process.env.HF_CREDENTIALS,});const result = await higgsfield.subscribe(  "ideogram/v4.0",  {    input: {      "prompt": "A cinematic scene at sunset",      "aspect_ratio": "1:1",      "rendering_speed": "DEFAULT"    },    withPolling: true,  },);console.log(result);

Ideogram 4.0 uses the model ID ideogram/v4.0. Ideogram 4.0 generates images from text prompts and allows image editing with adjustable aspect ratios and image influence. Users can control rendering speed and the degree to which the input image affects the output.

1. Calling the API

Send requests to https://api.higgsfield.ai/ideogram/v4.0 with a JSON body matching the parameters below.

Install

Install an official server-side SDK. cURL needs no package.

npm install @higgsfield/client

Setup

Keep credentials in server-side environment variables. The SDKs accept the same KEY_ID:KEY_SECRET value under their documented variable names.

export HF_CREDENTIALS="YOUR_KEY_ID:YOUR_KEY_SECRET" # TypeScript export HF_KEY="YOUR_KEY_ID:YOUR_KEY_SECRET" # Python and cURL

Request parameters

ParameterTypeRequiredDefaultDescription
promptstringYes—Prompt. Minimum length: 2. Maximum length: 2048.
image_urlstringNo—Input image.
aspect_ratiostringNo"1:1"Aspect ratio. Options: 1:1, 1:2, 2:1, 2:3, 3:2, 4:5, 5:4, 9:16, 16:9, 5:8, 8:5, 3:4, 4:3, 9:22, 22:9, 9:23, 23:9, 3:8, 8:3, 5:12, 12:5, 1:3, 3:1.
image_weightintegerNo—How strongly the output should preserve the input image. Minimum: 1. Maximum: 100.
rendering_speedstringNo"DEFAULT"Rendering speed. Options: TURBO, DEFAULT, QUALITY.

2. Authentication

The official SDKs read credentials from the server environment and send the required Authorization: Key KEY_ID:KEY_SECRET header.

API Key

Never expose the secret in browser-side code or commit it to source control. The TypeScript SDK is server-side only. For direct HTTP calls, use:

Authorization: Key $HF_KEY

3. Queue

subscribe submits the asynchronous request and waits for a terminal result. The TypeScript SDK polls automatically when withPolling: true; the Python SDK's synchronous subscribe call also waits. A completed request returns generated files in the images array.

Submit and wait

import { config, higgsfield } from "@higgsfield/client/v2"; config({ credentials: process.env.HF_CREDENTIALS, }); const result = await higgsfield.subscribe( "ideogram/v4.0", { input: { "prompt": "A cinematic scene at sunset", "aspect_ratio": "1:1", "rendering_speed": "DEFAULT" }, withPolling: true, }, ); console.log(result);

Explicit lifecycle control

Use the Python SDK when a worker needs explicit status, result, or cancellation control for an existing request. The TypeScript v2 client currently exposes automatic polling through subscribe.

import higgsfield_client request_id = "{request_id}" status = higgsfield_client.status(request_id=request_id) result = higgsfield_client.result(request_id=request_id) higgsfield_client.cancel(request_id=request_id)