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

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/base",
    arguments={
        "prompt": "Grandmother knitting by a window, an empty chair by her"
    },
    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:"landscape_4_3"
The size of the generated image. Default value: landscape_4_3Possible values: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9
num_inference_steps
integer
default:"28"
The number of inference steps to perform. Default value: 28Range: 1 to 50
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
guidance_scale
float
default:"4"
The guidance scale to use for the image generation. Default value: 4Range: 1 to 20
negative_prompt
string
default:""
The negative prompt to use for the image generation. Default value: ""

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": "Grandmother knitting by a window, an empty chair by her",
  "image_size": "landscape_4_3",
  "num_inference_steps": 28,
  "sync_mode": false,
  "num_images": 1,
  "enable_safety_checker": true,
  "output_format": "png",
  "acceleration": "regular",
  "guidance_scale": 4,
  "negative_prompt": ""
}

Output Example

{
  "images": [
    {
      "content_type": "image/png",
      "height": 768,
      "url": "https://v3b.fal.media/files/b/0a8c18a5/1z0k9F1YLgz4qCr64jCBa_r2uqRyDg.png",
      "width": 1024
    }
  ],
  "prompt": ""
}

Limitations

  • image_size restricted to: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9
  • num_inference_steps range: 1 to 50
  • num_images range: 1 to 4
  • output_format restricted to: jpeg, png, webp
  • acceleration restricted to: none, regular, high
  • guidance_scale range: 1 to 20
  • Content moderation via safety checker