Skip to main content
Endpoint: POST https://fal.run/fal-ai/bytedance/seedream/v4/edit Endpoint ID: fal-ai/bytedance/seedream/v4/edit

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/bytedance/seedream/v4/edit",
    arguments={
        "prompt": "Dress the model in the clothes and hat. Add a cat to the scene and change the background to a Victorian era building.",
        "image_urls": [
            "https://storage.googleapis.com/falserverless/example_inputs/seedream4_edit_input_1.png",
            "https://storage.googleapis.com/falserverless/example_inputs/seedream4_edit_input_2.png",
            "https://storage.googleapis.com/falserverless/example_inputs/seedream4_edit_input_3.png",
            "https://storage.googleapis.com/falserverless/example_inputs/seedream4_edit_input_4.png"
        ]
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)

Input Schema

prompt
string
required
The text prompt used to edit the image
image_size
ImageSize | Enum
default:"[object Object]"
The size of the generated image. The minimum total image area is 921600 pixels. Failing this, the image size will be adjusted to by scaling it up, while maintaining the aspect ratio.Possible values: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, auto, auto_2K, auto_4K
num_images
integer
default:"1"
Number of separate model generations to be run with the prompt. Default value: 1Range: 1 to 6
max_images
integer
default:"1"
If set to a number greater than one, enables multi-image generation. The model will potentially return up to max_images images every generation, and in total, num_images generations will be carried out. In total, the number of images generated will be between num_images and max_images*num_images. The total number of images (image inputs + image outputs) must not exceed 15 Default value: 1Range: 1 to 6
seed
integer
Random seed to control the stochasticity of image generation.
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.
enable_safety_checker
boolean
default:"true"
If set to true, the safety checker will be enabled. Default value: true
enhance_prompt_mode
EnhancePromptModeEnum
default:"standard"
The mode to use for enhancing prompt enhancement. Standard mode provides higher quality results but takes longer to generate. Fast mode provides average quality results but takes less time to generate. Default value: "standard"Possible values: standard, fast
image_urls
list<string>
required
List of URLs of input images for editing. Presently, up to 10 image inputs are allowed. If over 10 images are sent, only the last 10 will be used.

Output Schema

images
list<Image>
required
Generated images
seed
integer
required
Seed used for generation

Input Example

{
  "prompt": "Dress the model in the clothes and hat. Add a cat to the scene and change the background to a Victorian era building.",
  "image_size": {
    "height": 2160,
    "width": 3840
  },
  "num_images": 1,
  "max_images": 1,
  "sync_mode": false,
  "enable_safety_checker": true,
  "enhance_prompt_mode": "standard",
  "image_urls": [
    "https://storage.googleapis.com/falserverless/example_inputs/seedream4_edit_input_1.png",
    "https://storage.googleapis.com/falserverless/example_inputs/seedream4_edit_input_2.png",
    "https://storage.googleapis.com/falserverless/example_inputs/seedream4_edit_input_3.png",
    "https://storage.googleapis.com/falserverless/example_inputs/seedream4_edit_input_4.png"
  ]
}

Output Example

{
  "images": [
    {
      "url": "https://storage.googleapis.com/falserverless/example_outputs/seedream4_edit_output.png"
    }
  ],
  "seed": 746406749
}

Limitations

  • num_images range: 1 to 6
  • max_images range: 1 to 6
  • enhance_prompt_mode restricted to: standard, fast
  • Content moderation via safety checker