Skip to content

Image input

Most models take a text prompt only. A model that also accepts an input image says so on its page and in the table below; passing image to any other model raises an error.

Model Image input Option
joyai-image-edit optional image
joyai-image-edit-plus required image
qwen-image-edit required image
qwen-image-edit-2509 required image
sdxl-refiner-1.0 required image
flux1-kontext-dev optional image
visualcloze-384 required image
omnigen-v1 optional image
from PIL import Image
from imagehub import pipeline

with pipeline("t2i", backend="flux1-kontext-dev", model="checkpoints/flux1-kontext-dev") as edit:
    result = edit("Add a red hat to the scene", image=Image.open("photo.png"), seed=0)

result.images[0].save("edited.png")
  • image takes a PIL.Image.Image or an imagehub.Image. Pillow is only needed for the first.
  • When the option is optional, leaving it out generates from the text alone.
  • There is no separate "edit" task: the same t2i pipeline takes the extra option.