{
 "openapi": "3.0.3",
 "info": {
  "title": "Instruction edits (default): Qwen-Image-2.1-Turbo",
  "version": "2026-11-21",
  "description": "Curated ZeroGPU tool from the ZeroGPU lineup catalog. Calls go straight to the upstream Space hugging-apps/qwen-qwen-image-2-1-turbo; send your own HF token as a bearer token so the call uses your ZeroGPU quota."
 },
 "servers": [
  {
   "url": "https://hugging-apps-qwen-qwen-image-2-1-turbo.hf.space"
  }
 ],
 "x-zerogpu": {
  "category": "Image editing",
  "slot": "Instruction edits",
  "need": "The default \"change X in this image\" tool that most edit requests go through.",
  "role": "default",
  "space": "hugging-apps/qwen-qwen-image-2-1-turbo",
  "space_url": "https://huggingface.co/spaces/hugging-apps/qwen-qwen-image-2-1-turbo",
  "model": "Qwen-Image-2.1-Turbo",
  "license": "Qwen Research (non-commercial)",
  "license_class": "nc",
  "gpu_seconds_booked": "11\u201338",
  "notes": "Fast, stateless editing with an NCII guard. AA rated Turbo at 1063 on 9 Nov (it has since left the open-weights list), against 1082 for full Qwen-Image-2.1. The same endpoint also handles generation.",
  "caveats": "Resolution defaults to 2048, so pass \"1024\" to save quota.",
  "lineup_call": "/generate(prompt, input_images=[{image, caption}], resolution=\"1024\", aspect_ratio=\"Auto\") \u2192 RGBA image",
  "api_style": "v2",
  "mcp_url": "https://hugging-apps-qwen-qwen-image-2-1-turbo.hf.space/gradio_api/mcp/"
 },
 "components": {
  "securitySchemes": {
   "hfToken": {
    "type": "http",
    "scheme": "bearer",
    "description": "Your own Hugging Face token (read scope is enough). It is sent only to the upstream Space and bills that call to your account's ZeroGPU quota. Without it the call runs on the small anonymous quota."
   }
  },
  "schemas": {}
 },
 "paths": {
  "/gradio_api/call/v2/generate": {
   "post": {
    "summary": "Instruction edits (default): Qwen-Image-2.1-Turbo",
    "description": "The default \"change X in this image\" tool that most edit requests go through. Step 1 of 2: returns {\"event_id\"}; then GET /gradio_api/call/generate/{event_id} reads an SSE stream whose `event: complete` data is the JSON output array (`event: error` on failure). Upstream: https://huggingface.co/spaces/hugging-apps/qwen-qwen-image-2-1-turbo. License: Qwen Research (non-commercial). Caveats: Resolution defaults to 2048, so pass \"1024\" to save quota. \n\nUpstream description: Generate or edit an image with Qwen-Image-2.1-Turbo (8 steps). With no input images this is text-to-image; with one to ten input images it is image editing, and the prompt may refer to them as <image1>\u2026<image10>.Output must be fetched from GET /gradio_api/call/generate/{event_id}. Returns an array of 1 elements of the following format: [\"output ({'type': 'object', 'description': 'JSON object with url key to fetch the output'})\"]",
    "operationId": "image_edit_instruction_edits",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "prompt": {
          "type": "string"
         },
         "input_images": {
          "items": {
           "anyOf": [
            {
             "properties": {
              "image": {
               "type": "object",
               "required": [
                "path",
                "meta"
               ],
               "description": "A file. Set path to a public https URL (or a path returned by POST /gradio_api/upload on the same Space) and meta to {\"_type\": \"gradio.FileData\"}.",
               "properties": {
                "path": {
                 "type": "string"
                },
                "url": {
                 "type": "string"
                },
                "orig_name": {
                 "type": "string"
                },
                "meta": {
                 "type": "object",
                 "properties": {
                  "_type": {
                   "type": "string",
                   "enum": [
                    "gradio.FileData"
                   ]
                  }
                 }
                }
               }
              },
              "caption": {
               "type": "string",
               "default": null,
               "title": "Caption",
               "nullable": true
              }
             },
             "required": [
              "image"
             ],
             "title": "GalleryImage",
             "type": "object"
            },
            {
             "properties": {
              "video": {
               "type": "object",
               "required": [
                "path",
                "meta"
               ],
               "description": "A file. Set path to a public https URL (or a path returned by POST /gradio_api/upload on the same Space) and meta to {\"_type\": \"gradio.FileData\"}.",
               "properties": {
                "path": {
                 "type": "string"
                },
                "url": {
                 "type": "string"
                },
                "orig_name": {
                 "type": "string"
                },
                "meta": {
                 "type": "object",
                 "properties": {
                  "_type": {
                   "type": "string",
                   "enum": [
                    "gradio.FileData"
                   ]
                  }
                 }
                }
               }
              },
              "caption": {
               "type": "string",
               "default": null,
               "title": "Caption",
               "nullable": true
              }
             },
             "required": [
              "video"
             ],
             "title": "GalleryVideo",
             "type": "object"
            }
           ]
          },
          "title": "GalleryData",
          "type": "array"
         },
         "seed": {
          "type": "number",
          "description": "numeric value between 0 and 2147483647"
         },
         "resolution": {
          "type": "integer",
          "enum": [
           1024,
           1536,
           2048
          ]
         },
         "aspect_ratio": {
          "type": "string",
          "enum": [
           "Auto",
           "1:1",
           "4:3",
           "3:4",
           "3:2",
           "2:3",
           "16:9",
           "9:16"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Job accepted.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "event_id"
         ],
         "properties": {
          "event_id": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "tags": [
     "Image editing"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  },
  "/gradio_api/call/generate/{event_id}": {
   "get": {
    "summary": "Fetch results for /generate",
    "description": "Returns a stream of server-sent events (SSE). The final event has `event: complete` with `data` containing a JSON array of outputs.",
    "operationId": "image_edit_instruction_edits_result",
    "parameters": [
     {
      "name": "event_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The event_id returned by the POST request"
     }
    ],
    "responses": {
     "200": {
      "description": "SSE stream with event: complete containing a JSON array of outputs",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    },
    "tags": [
     "Image editing"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  },
  "/gradio_api/upload": {
   "post": {
    "summary": "Upload File",
    "operationId": "image_edit_instruction_edits_upload",
    "parameters": [
     {
      "name": "upload_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "nullable": true,
       "default": null
      },
      "description": "Optional ID to track upload progress"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "files": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "binary"
          },
          "description": "One or more files to upload"
         }
        },
        "required": [
         "files"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "List of file paths where the uploaded files were saved",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "string"
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid content type or invalid file name",
      "content": {
       "text/plain": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "413": {
      "description": "File exceeds maximum allowed size",
      "content": {
       "text/plain": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    },
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  }
 }
}