Skip to main content

Python SDK

The official Python client, imagepipeline on PyPI. Parameters below are generated from the live API spec.

Install

pip install imagepipeline

Requires Python 3.9+.

Initialize

Grab an API key from the dashboard, see Authentication.

from imagepipeline import ImagePipeline

ip = ImagePipeline("ip_live_xxxxxxxxxxxx")

Quick examples

# Generate
result = ip.generate.image(prompt="fashion model, white studio background, editorial lighting")
print(result.url)

# Virtual try-on
result = ip.identity.tryon(
person_image="https://cdn.example.com/model.jpg",
clothing_image="https://cdn.example.com/shirt.jpg",
gender="woman",
)
print(result.url)

Async and webhooks

Every compute method blocks and polls by default. Pass wait=False to get a job id back immediately, or pass callback_url to receive a webhook when the job completes. See Jobs & Webhooks.

job = ip.generate.image(prompt="...", wait=False)
print(job.job_id)

Parameter reference

Snake_case keyword arguments per method. Every compute method also accepts wait (default True). Profiles also expose list_profiles(), get_profile(profile_id), and delete_profile(profile_id).

Generate

Generate image

ip.generate.image(...) · POST /generate/image/v1

ParameterTypeDefaultDescription
promptstring-Required. Text prompt describing the image to generate.
heightinteger1024Output height in pixels (max 1024).
widthinteger1024Output width in pixels (max 1024).
num_inference_stepsinteger-Number of denoising steps. Default 8
guidance_scalenumber-Guidance scale. Omit to use the model default (0.0 for Z-Image Turbo).
seedinteger-1Seed for reproducibility. -1 = random.
enhance_promptbooleanfalseRun the prompt through a lightweight AI enhancer before generation. Expands terse prompts into detailed visual descriptions - useful for short or abstract inputs. Adds ~1-2 s. Default false.
logo_urlstring-Public URL of your company logo (PNG or WebP with transparency recommended). Stamped at bottom-right at 50% opacity.
output_formatstring"webp"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
callback_urlstring-Optional webhook URL. When the job completes or fails we POST a WebhookEvent object to this URL. See the WebhookEvent schema (Webhooks section) for the exact payload shape. result_url in the payload is temporary (∼24 h) - download the file immediately.
profile_idstring-Identity profile ID from /profiles/v1. When provided, the profile's prompt_template and quality settings are applied automatically - keeping theme and brand context consistent across a generation chain.
server_idstring-Enterprise: pod ID to pin this request to a specific dedicated pod.

Generate video

ip.generate.video(...) · POST /generate/video/v1

ParameterTypeDefaultDescription
input_imagestring-Required. Public URL of the image to animate.
promptstring"make this image come alive, cinematic motion, smooth animation"Describe the animation style or motion. Defaults to cinematic motion.
heightinteger512Output height in pixels (max 1536, must be divisible by 32).
widthinteger896Output width in pixels (max 1536, must be divisible by 32).
duration_secondsnumber2Video duration in seconds (0.1-10.0).
seedinteger42Seed for reproducibility.
callback_urlstring-Optional webhook URL. When the job completes or fails we POST a WebhookEvent object to this URL. See the WebhookEvent schema (Webhooks section) for the exact payload shape. result_url in the payload is temporary (∼24 h) - download the file immediately.
server_idstring-Enterprise: pod ID to pin this request to a specific dedicated pod.

Generate speech

ip.generate.speech(...) · POST /generate/speech/v1

ParameterTypeDefaultDescription
textstring-Required. Text to convert to speech.
language_idstring"en"Language code (e.g. en, zh, ja, ko, he).
target_voice_pathstring-Public URL of a reference voice audio file for voice cloning (WAV/MP3, 5-30 s recommended). Required for /identity/voice/clone. If omitted on /generate/speech, a default voice is used.
max_new_tokensinteger256Maximum tokens to generate.
exaggerationnumber0.5Expressiveness level (0.0 = neutral, 1.0 = maximum).
apply_watermarkbooleantrueEmbed an inaudible audio watermark in the output (recommended for compliance).
callback_urlstring-Optional webhook URL. When the job completes or fails we POST a WebhookEvent object to this URL. See the WebhookEvent schema (Webhooks section) for the exact payload shape. result_url in the payload is temporary (∼24 h) - download the file immediately.
server_idstring-Enterprise: pod ID to pin this request to a specific dedicated pod.

Generate 3D

ip.generate.generate_3d(...) · POST /generate/3d/v1

ParameterTypeDefaultDescription
image_pathstring-Required. Public URL or path of the input image to convert to 3D.
modestring"generate"Generation mode: generate (mesh only), paint (texture an existing mesh), or generate_and_paint (mesh + textures in one pass).
mesh_save_namestring-Optional filename for the output mesh (e.g. model.obj).
painted_save_namestring-Optional filename for the textured/painted mesh.
auto_unloadbooleantrueUnload the generation pipeline from GPU after completion to free memory.
callback_urlstring-Optional webhook URL. When the job completes or fails we POST a WebhookEvent object to this URL. See the WebhookEvent schema (Webhooks section) for the exact payload shape. result_url in the payload is temporary (∼24 h) - download the file immediately.
server_idstring-Enterprise: pod ID to pin this request to a specific dedicated pod.

Edit

Edit image

ip.edit.image(...) · POST /edit/image/v1

ParameterTypeDefaultDescription
input_imagestring or array<string>-Image(s) to edit. Pass a single URL string, or an array of URL strings to provide multiple reference images (e.g. two subjects to combine).
promptstring-Required. Instruction describing the edits to apply.
modestring-Processing mode. Use anime to convert a photo to an illustrated/anime style.
output_formatstring"webp"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
palettearray<string>-Brand colour palette as hex codes (e.g. ['#FF5733']). Blended into the output.
num_inference_stepsinteger-Number of diffusion steps (1-100). Higher = better quality but slower. Default: 8.
guidance_scalenumber-Classifier-free guidance scale (0.0-20.0). Set to 0 to disable CFG (distilled/Lightning models). Default: 1.5.
seedinteger-1Seed for reproducibility. -1 = random.
callback_urlstring-Optional webhook URL. When the job completes or fails we POST a WebhookEvent object to this URL. See the WebhookEvent schema (Webhooks section) for the exact payload shape. result_url in the payload is temporary (∼24 h) - download the file immediately.
profile_idstring-Identity profile ID from /profiles/v1. When provided, the profile's prompt_template, quality settings, and brand palette are applied automatically - keeping theme and brand context consistent across an editing chain.
refine_strengthnumber-Z-Image Turbo refinement pass after editing (0.0-1.0). At 0.25-0.40, preserves composition from the edit step while improving skin photorealism and texture detail. Omit or set to 0 to skip the refinement pass.
faster_inferencebooleantrueWhen true (default), uses the Lightning LoRA distillation for fast 8-step inference. Set to false for higher-quality 20-step inference without distillation - slower but preserves finer product and skin details.
cfg_norm_strengthnumber-CFG normalization strength (0.0-1.0). Rescales the guided prediction to match the magnitude of the conditioned-only prediction, preventing colour saturation and tone shifts caused by high true_cfg_scale. Try 0.5-0.8 when colours look oversaturated. 0 (default) disables it.
product_saturationnumber-Saturation multiplier applied to the product image (image 2) before editing. 0.0 = greyscale, 1.0 = unchanged, <1.0 desaturates (e.g. 0.85 reduces colour shift). Omit to use the server default (0.85).
tone_correctionnumber-Post-edit tonal correction strength (0.0-1.0). Corrects colour drift that diffusion models introduce in edited regions - blends the colour profile of the edited area toward the original image. 0.0 disables it, 1.0 is full correction. Default: 0.6. Lower values (0.3-0.5) preserve more of the model's generated colour.
has_textboolean-Whether the image contains visible text, logos, or labels. When false, text detection (EasyOCR) is skipped - saves ~2-3 s if your image has no text. When true or omitted, text regions are auto-detected and preserved during background changes. Only applies to bg_change edits.
has_productboolean-Whether the image contains a physical product as the main subject. Passed to the worker for routing and analytics. Does not affect mask logic.
server_idstring-Enterprise: pod ID to pin this request to a specific dedicated pod.

Background

Change background

ip.background.change(...) · POST /background/change/image/v1

ParameterTypeDefaultDescription
input_imagestring-Required. Public URL of the image whose background will be replaced.
promptstring-Required. Describe the new background - e.g. beach at sunset, white studio background, forest path in autumn.
use_segmentationbooleantrueWhen true (default), the subject is isolated and composited back over the generated background - preserves subject edges cleanly. When false, the full image edit is used with colour correction.
tone_correctionnumber-Colour correction strength (0.0-1.0). Blends the edited background's colour profile toward the original to reduce drift. Default: 0.6.
subject_descriptionstring-Required. Short description of the main subject to preserve - e.g. protein powder tub, glass bottle, sneakers, person. Helps the segmentation model identify exactly what to keep.
has_textboolean-Whether the image contains visible text or labels. Set to false to skip text detection and save ~2-3 s. Omit to auto-detect.
palettearray<string>-Brand colour palette as hex codes. Blended into the output.
num_inference_stepsinteger-Number of diffusion steps. Default: 8. Higher = more detail, slower.
true_cfg_scalenumber-CFG scale. Default: 4.0.
faster_inferenceboolean-Enable faster inference mode. Default: true.
output_formatstring"webp"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
harmonize_strengthnumber-Lighting harmonization strength (0.0-1.0). When set, the subject's low-frequency lighting and colour cast are shifted to match the generated background (frequency-separated relight: high-frequency texture/labels stay from the original). 0.7 is a good starting point. Omit or 0 to disable (default).
seedinteger-1Seed for reproducibility. -1 = random.
callback_urlstring-Webhook URL. When the job completes or fails we POST a WebhookEvent to this URL. result_url is temporary (~24 h) - download the file promptly.

Remove background

ip.background.remove(...) · POST /background/remove/image/v1

ParameterTypeDefaultDescription
input_imagestring-Required. Public URL of the image to process.
recolorstring-Hex color to use as the new background, e.g. #FFFFFF or F0F0F0. When omitted, only the transparent cutout is returned.
drop_shadowbooleanfalseAdd a soft drop shadow beneath the subject before compositing.
shadow_opacitynumber0.38Shadow darkness 0-1.
shadow_blurnumber0.018Blur radius as fraction of image width.
shadow_dynumber0.022Vertical shadow offset as fraction of height.
shadow_dxnumber0.004Horizontal shadow offset as fraction of width.
output_formatstring"png"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
callback_urlstring-Optional webhook URL. A WebhookEvent is POSTed when the job completes or fails. result_url in the payload is temporary (∼24 h) - download immediately.

Upscale

Upscale image

ip.upscale.image(...) · POST /upscale/image/v1

ParameterTypeDefaultDescription
input_imagestring-Required. Public URL of the image to upscale and enhance.
scaleinteger4Upscale factor: 1 (enhance only), 2, 3, or 4. Default: 4.
output_formatstring"webp"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
callback_urlstring-Optional webhook URL. When the job completes or fails we POST a WebhookEvent object to this URL. See the WebhookEvent schema (Webhooks section) for the exact payload shape. result_url in the payload is temporary (∼24 h) - download the file immediately.
server_idstring-Enterprise: pod ID to pin this request to a specific dedicated pod.

Branding

Logo placement

ip.branding.logo(...) · POST /branding/logo/image/v1

ParameterTypeDefaultDescription
input_imagestring-Required. Public URL of the base image to stamp the logo onto.
logo_urlstring-Required. Public URL of your logo (PNG with transparency recommended). Stamped at the chosen corner at 50% opacity.
positionstring"bottom_right"Corner to place the logo stamp. Default: bottom_right. One of: bottom_right, bottom_left, top_right, top_left.
output_formatstring"webp"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
callback_urlstring-Webhook URL. When the job completes or fails we POST a WebhookEvent to this URL. result_url is temporary (~24 h) - download the file promptly.

Branded template

ip.branding.template(...) · POST /branding/template/image/v1

ParameterTypeDefaultDescription
input_imagestring-Required. Public URL of your model or product photo. The brand palette is extracted automatically from the clothing and accessories.
background_promptstring"clean professional studio background"Describe the background scene - e.g. urban rooftop at dusk, minimal white studio, lush botanical garden. The derived palette colors are automatically injected into this prompt.
palette_modestring"similar"How the background palette relates to the outfit colors: - similar - same hue family, harmonious and safe - complementary - opposite on the color wheel, classic contrast - radical - triadic shift with boosted saturation, bold and eye-catching One of: similar, complementary, radical.
subject_descriptionstring-Short description of the subject to preserve - e.g. woman in red dress, sneaker, glass bottle. Helps the segmentation model identify what to keep.
logo_urlstring-Public URL of your logo (PNG with transparency recommended). Stamped at the chosen corner at 50% opacity after background generation.
positionstring"bottom_right"Corner for the logo stamp. Default: bottom_right. One of: bottom_right, bottom_left, top_right, top_left.
output_formatstring"webp"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
seedinteger-1Seed for reproducibility. -1 = random.
callback_urlstring-Webhook URL. When the job completes or fails we POST a WebhookEvent to this URL. result_url is temporary (~24 h) - download the file promptly.

Identity & Creator

Virtual try-on

ip.identity.tryon(...) · POST /creator/tryon/image/v1

ParameterTypeDefaultDescription
person_imagestring-Required. Public URL of the person/model image (the body to dress).
clothing_imagestring-Required. Public URL of the clothing item to place on the person.
genderstring-Required. Gender of the person (man or woman). One of: man, woman.
clothing_typestring-Required. Type of clothing shown in clothing_image. Be specific for best results - e.g. jacket, dress, blazer, jeans, shirt, skirt.
widthinteger-Output width in pixels (256-2048). Defaults to the person image's native width (capped at 2048 and rounded to 16). For clothing try-on, portrait dimensions (e.g. 832 × 1248) give the best results.
heightinteger-Output height in pixels (256-2048). Defaults to the person image's native height (capped at 2048 and rounded to 16). For clothing try-on, portrait dimensions (e.g. 832 × 1248) give the best results.
output_formatstring"png"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
seedinteger-1Seed for reproducibility. -1 = random.
garment_regionstring"upper"Which part of the body the garment covers. Controls the region where colour correction is applied so other clothing isn't affected. upper (default) - jacket, shirt, blazer, top. lower - pants, jeans, skirt, shorts. full - dress, jumpsuit, suit (whole body). One of: upper, lower, full.
tone_correctionnumber-Colour correction strength (0.0-1.0). Controls how closely the generated garment's colour is matched to the reference image. Default: 0.4. Lower values (0.2) preserve the AI's interpretation; higher values (0.6) pull the colour tighter to the clothing reference.
profile_idstring-Identity profile ID from /profiles/v1. Applies stored settings automatically.
callback_urlstring-Webhook URL. When the job completes or fails we POST a WebhookEvent to this URL. result_url in the payload is temporary (~24 h) - download the file promptly.

Face swap

ip.identity.faceswap(...) · POST /identity/faceswap/image/v1

ParameterTypeDefaultDescription
targetstring-Required. Public URL of the target image (the body/scene where the face will appear).
sourcestring-Required. Public URL of the source face image (the face to swap in).
upscalenumber1.5Output upscale factor (1.0-4.0).
restore_weightnumber0.5Face restoration strength (0.0-1.0). Higher = sharper face detail.
output_formatstring"webp"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
profile_idstring-Identity profile ID from /identity/profiles/v1. When provided, the profile's settings are applied automatically.
callback_urlstring-Optional webhook URL. When the job completes or fails we POST a WebhookEvent object to this URL. See the WebhookEvent schema (Webhooks section) for the exact payload shape. result_url in the payload is temporary (∼24 h) - download the file immediately.
server_idstring-Enterprise: pod ID to pin this request to a specific dedicated pod.

Identity lock

ip.identity.lock(...) · POST /identity/lock/image/v1

ParameterTypeDefaultDescription
input_imagestring-Required. Public URL of the source image whose identity will be locked and preserved.
promptstring-Required. Describe the desired scene or appearance changes. The person's identity is automatically preserved throughout.
heightinteger1024Output height in pixels (max 2048).
widthinteger1024Output width in pixels (max 2048).
output_formatstring"webp"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
palettearray<string>-Brand colour palette as hex codes. Blended into the output.
negative_promptstring-Negative prompt. Activates classifier-free guidance when set.
num_inference_stepsinteger-Number of diffusion steps (1-100). Higher = better quality but slower. Default: 8.
guidance_scalenumber-Classifier-free guidance scale (1.0-20.0). Higher = follows prompt more strictly. Default: 1.5.
seedinteger-1Seed for reproducibility. -1 = random.
profile_idstring-Identity profile ID from /identity/profiles/v1. When provided, the profile's settings override manual generation params.
callback_urlstring-Optional webhook URL. When the job completes or fails we POST a WebhookEvent object to this URL. See the WebhookEvent schema (Webhooks section) for the exact payload shape. result_url in the payload is temporary (∼24 h) - download the file immediately.
server_idstring-Enterprise: pod ID to pin this request to a specific dedicated pod.

Identity replace

ip.identity.replace(...) · POST /identity/replace/image/v1

ParameterTypeDefaultDescription
input_imagestring-Required. Public URL of the image whose identity will be replaced.
promptstring-Required. Describe the new person - e.g. caucasian woman with green eyes, 30-year-old man with short dark hair and a beard. The server constructs the full edit instruction from this description.
use_segmentationbooleantrueWhen true (default), only skin and hair are edited; clothing, background, and text are preserved from the original via masking and compositing. When false, the edit applies to the full image with colour correction scoped to the non-skin/hair region.
tone_correctionnumber-Colour correction strength after editing (0.0-1.0). Corrects colour drift in the edited region toward the original image. Default: 0.6. Set to 0.0 to disable.
output_formatstring"webp"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
seedinteger-1Seed for reproducibility. -1 = random.
palettearray<string>-Brand colour palette as hex codes. Blended into the output.
profile_idstring-Identity profile ID from /profiles/v1. Applies stored settings automatically.
callback_urlstring-Webhook URL. When the job completes or fails we POST a WebhookEvent to this URL. result_url is temporary (~24 h) - download the file promptly.

Instamodel

ip.identity.instamodel(...) · POST /creator/instamodel/image/v1

ParameterTypeDefaultDescription
promptstring-Required. Describe the scene, outfit, or style for the generated image.
input_facestring-Required. Public URL of the input face image.
heightinteger1024Output height in pixels (max 2048).
widthinteger768Output width in pixels (max 2048).
seedinteger-Seed for reproducibility (omit for random).
negative_promptstring-Negative prompt applied to the generation.
output_formatstring"webp"Output image format. Applies to all image-producing endpoints. One of: webp, jpeg, png.
profile_idstring-Identity profile ID from /profiles/v1. When provided, the profile's settings are applied automatically.
callback_urlstring-Optional webhook URL. When the job completes or fails we POST a WebhookEvent object to this URL. See the WebhookEvent schema (Webhooks section) for the exact payload shape. result_url in the payload is temporary (~24 h) - download the file immediately.
server_idstring-Enterprise: pod ID to pin this request to a specific dedicated pod.

Voice clone

ip.identity.voice_clone(...) · POST /identity/voice/clone/v1

ParameterTypeDefaultDescription
textstring-Required. Text to synthesise with the cloned voice.
reference_voice_urlstring-Required. Public URL of the reference voice audio file for cloning (WAV or MP3, 5-30 s recommended).
language_idstring"en"Language code (e.g. en, zh, ja, ko, he).
max_new_tokensinteger256Maximum tokens to generate.
exaggerationnumber0.5Expressiveness level (0.0 = neutral, 1.0 = maximum).
apply_watermarkbooleantrueEmbed an inaudible audio watermark in the output (recommended for compliance).
callback_urlstring-Optional webhook URL. When the job completes or fails we POST a WebhookEvent object to this URL. See the WebhookEvent schema (Webhooks section) for the exact payload shape. result_url in the payload is temporary (∼24 h) - download the file immediately.
server_idstring-Enterprise: pod ID to pin this request to a specific dedicated pod.

Profiles

Create identity profile

ip.identity.create_profile(...) · POST /profiles/v1

ParameterTypeDefaultDescription
namestring-Required. Human-readable name for this profile, e.g. 'Anna - summer campaign'.
descriptionstring-Optional notes about this identity profile.
tagsarray<string>-Optional tags for filtering, e.g. ['influencer', 'campaign-2026'].
callback_urlstring-Default webhook URL for job completion events from this profile. Overridable per-request.
intent_idstring-Optimise this profile for a specific intent, e.g. 'identity_lock'.
prompt_templatestring-Custom Jinja2 prompt template for this profile. Use {{user_prompt}} to inject the caller's prompt. Example: 'Portrait of Anna, {{user_prompt}}, consistent lighting'.
negative_promptstring-Negative prompt applied to every job using this profile.
stepsinteger--
cfg_scalenumber--
seed_strategystring"random"'random' - new seed per job; 'fixed' - always use fixed_seed; 'user' - honour per-request seed if provided.
fixed_seedinteger-Seed to use when seed_strategy='fixed'. Ignored for other strategies.
palettearray<string>-Brand color palette as hex codes applied to all jobs from this profile (e.g. ['#FF5733', '#3498DB']).
heightinteger-Default output image height.
widthinteger-Default output image width.
output_formatstring-Default output format: 'webp', 'jpeg', or 'png'. Use 'png' for editing chains; 'webp' for final app delivery.
prompt_template_modestring"suffix"How to combine the profile's prompt_template with the caller's prompt. 'suffix' (default) appends the template after the user prompt; 'prefix' prepends it before.
extra_paramsobject-Additional model-specific parameters passed through to the worker.

Upload

Upload image

ip.upload.image(...) · POST /upload/image/v1

Pass a local file path (or file object). Returns a hosted url you can feed into any other method.

ParameterTypeDefaultDescription
filestring-Required. Image file to upload (PNG, JPEG, WebP, GIF - max 20 MB).