CoolFace
Modelpublic

mickee00000/qwen-image-2-1-endpoint

sourceHugging Faceupdated 4d agoView on Hugging Face
0likes
Model Card

Qwen Image 2.1 — Hugging Face Endpoint handler

This repository contains the custom EndpointHandler used by the dedicated Inference Endpoint. It loads the public Qwen/Qwen-Image-2.1 checkpoint with QwenImage21Pipeline; the weights are downloaded by the endpoint at startup and are not copied into this repository.

Text-to-image request

Send JSON and request a PNG response:

json
{
  "inputs": "A ceramic teapot on a wooden table",
  "parameters": {
    "width": 1024,
    "height": 1024,
    "num_inference_steps": 40,
    "seed": 42
  }
}

The supported dimensions are multiples of 16, from 512 to 2752 pixels, with a maximum of 7 million pixels per image. The default is 2048×2048 and 40 steps. The handler returns the first image when a request asks for multiple images.

Image editing request

Add a base64-encoded image in image (or a list in images) and use the same JSON shape:

json
{
  "inputs": "Change the background to a sunset beach",
  "image": "<base64 PNG or data:image/png;base64,...>"
}

The endpoint is authenticated. Keep the endpoint URL and access token private.