Skip to main content
Endpoint: POST https://fal.run/fal-ai/z-image/turbo/inpaint Endpoint ID: fal-ai/z-image/turbo/inpaint

Try it in the Playground

Run this model interactively with your own prompts.

Quick Start

import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/z-image/turbo/inpaint",
    arguments={
        "prompt": "A young Asian woman with long, vibrant purple hair stands on a sunlit sandy beach, posing confidently with her left hand resting on her hip. She gazes directly at the camera with a neutral expression. A sleek black ribbon bow is tied neatly on the right side of her head, just above her ear. She wears a flowing white cotton dress with a fitted bodice and a flared skirt that reaches mid-calf, slightly lifted by a gentle sea breeze. The beach behind her features fine, pale golden sand with subtle footprints, leading to calm turquoise waves under a clear blue sky with soft, wispy clouds. The lighting is natural daylight, casting soft shadows to her left, indicating late afternoon sun. The horizon line is visible in the background, with a faint silhouette of distant dunes. Her skin tone is fair with a natural glow, and her facial features are delicately defined. The composition is centered on her figure, framed from mid-thigh up, with shallow depth of field blurring the distant waves slightly.",
        "image_url": "https://storage.googleapis.com/falserverless/example_inputs/inpaint-input.jpg",
        "mask_image_url": "https://storage.googleapis.com/falserverless/whls/z-image-inpaint-mask.jpg"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)

Input Schema

prompt
string
required
The prompt to generate an image from.
image_size
ImageSize | Enum
default:"auto"
The size of the generated image. Default value: autoPossible values: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto
num_inference_steps
integer
default:"8"
The number of inference steps to perform. Default value: 8Range: 1 to 8
seed
integer
The same seed and the same prompt given to the same version of the model will output the same image every time.
sync_mode
boolean
default:"false"
If True, the media will be returned as a data URI and the output data won’t be available in the request history.
num_images
integer
default:"1"
The number of images to generate. Default value: 1Range: 1 to 4
enable_safety_checker
boolean
default:"true"
If set to true, the safety checker will be enabled. Default value: true
output_format
OutputFormatEnum
default:"png"
The format of the generated image. Default value: "png"Possible values: jpeg, png, webp
acceleration
AccelerationEnum
default:"regular"
The acceleration level to use. Default value: "regular"Possible values: none, regular, high
enable_prompt_expansion
boolean
default:"false"
Whether to enable prompt expansion. Note: this will increase the price by 0.0025 credits per request.
image_url
string
required
URL of Image for Inpaint generation.
control_scale
float
default:"0.75"
The scale of the controlnet conditioning. Default value: 0.75Range: 0 to 1
control_start
float
default:"0"
The start of the controlnet conditioning.Range: 0 to 1
control_end
float
default:"0.8"
The end of the controlnet conditioning. Default value: 0.8Range: 0 to 1
mask_image_url
string
required
URL of Mask for Inpaint generation.
strength
float
default:"1"
The strength of the inpaint conditioning. Default value: 1

Output Schema

images
list<ImageFile>
required
The generated image files info.
timings
Timings
required
The timings of the generation process.
seed
integer
required
Seed of the generated Image. It will be the same value of the one passed in the input or the randomly generated that was used in case none was passed.
has_nsfw_concepts
list<boolean>
required
Whether the generated images contain NSFW concepts.
prompt
string
required
The prompt used for generating the image.

Input Example

{
  "prompt": "A young Asian woman with long, vibrant purple hair stands on a sunlit sandy beach, posing confidently with her left hand resting on her hip. She gazes directly at the camera with a neutral expression. A sleek black ribbon bow is tied neatly on the right side of her head, just above her ear. She wears a flowing white cotton dress with a fitted bodice and a flared skirt that reaches mid-calf, slightly lifted by a gentle sea breeze. The beach behind her features fine, pale golden sand with subtle footprints, leading to calm turquoise waves under a clear blue sky with soft, wispy clouds. The lighting is natural daylight, casting soft shadows to her left, indicating late afternoon sun. The horizon line is visible in the background, with a faint silhouette of distant dunes. Her skin tone is fair with a natural glow, and her facial features are delicately defined. The composition is centered on her figure, framed from mid-thigh up, with shallow depth of field blurring the distant waves slightly.",
  "image_size": "auto",
  "num_inference_steps": 8,
  "sync_mode": false,
  "num_images": 1,
  "enable_safety_checker": true,
  "output_format": "png",
  "acceleration": "regular",
  "enable_prompt_expansion": false,
  "image_url": "https://storage.googleapis.com/falserverless/example_inputs/inpaint-input.jpg",
  "control_scale": 0.75,
  "control_start": 0,
  "control_end": 0.8,
  "mask_image_url": "https://storage.googleapis.com/falserverless/whls/z-image-inpaint-mask.jpg",
  "strength": 1
}

Output Example

{
  "images": [
    {
      "content_type": "image/png",
      "height": 888,
      "url": "https://storage.googleapis.com/falserverless/example_outputs/z-image-inpaint-output.png",
      "width": 512
    }
  ],
  "prompt": ""
}

Limitations

  • image_size restricted to: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto
  • num_inference_steps range: 1 to 8
  • num_images range: 1 to 4
  • output_format restricted to: jpeg, png, webp
  • acceleration restricted to: none, regular, high
  • control_scale range: 0 to 1
  • control_start range: 0 to 1
  • control_end range: 0 to 1
  • Content moderation via safety checker