File size: 7,893 Bytes
fea5887
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
{
 "openapi": "3.0.3",
 "info": {
  "title": "Virtual try-on (default): FASHN VTON 1.5 (972M, maskless)",
  "version": "2026-11-21",
  "description": "Curated ZeroGPU tool from the ZeroGPU lineup catalog. Calls go straight to the upstream Space fashn-ai/fashn-vton-1.5; send your own HF token as a bearer token so the call uses your ZeroGPU quota."
 },
 "servers": [
  {
   "url": "https://fashn-ai-fashn-vton-1-5.hf.space"
  }
 ],
 "x-zerogpu": {
  "category": "Image editing",
  "slot": "Virtual try-on",
  "need": "E-commerce and fashion mockups from a person photo and a garment.",
  "role": "default",
  "space": "fashn-ai/fashn-vton-1.5",
  "space_url": "https://huggingface.co/spaces/fashn-ai/fashn-vton-1.5",
  "model": "FASHN VTON 1.5 (972M, maskless)",
  "license": "Apache-2.0",
  "license_class": "open",
  "gpu_seconds_booked": "60",
  "notes": "Official, stateless, needs no mask, and accepts flat-lay product photos.",
  "caveats": "",
  "lineup_call": "/try_on(person_image, garment_image, category=\"tops\"|\"bottoms\"|\"one-pieces\", garment_photo_type=\"model\"|\"flat-lay\", num_timesteps=50, seed=42) \u2192 image",
  "api_style": "v1"
 },
 "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/try_on": {
   "post": {
    "description": "E-commerce and fashion mockups from a person photo and a garment. Step 1 of 2: returns {\"event_id\"}; then GET /gradio_api/call/try_on/{event_id} reads an SSE stream whose `event: complete` data is the JSON output array (`event: error` on failure). Upstream: https://huggingface.co/spaces/fashn-ai/fashn-vton-1.5. License: Apache-2.0. \n\nUpstream description: Run virtual try-on inference.\nReturns, in order: Try-On Result: dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: dict(str, Any))",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "data"
        ],
        "properties": {
         "data": {
          "type": "array",
          "minItems": 2,
          "maxItems": 8,
          "items": {},
          "description": "Positional inputs, in this order:\n0. person_image: dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: dict(str, Any)) (required)\n1. garment_image: dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: dict(str, Any)) (required)\n2. category: Literal['tops', 'bottoms', 'one-pieces'] (default \"tops\")\n3. garment_photo_type: Literal['model', 'flat-lay'] (default \"model\")\n4. num_timesteps: float (default 50)\n5. guidance_scale: float (default 1.5)\n6. seed: int (default 42)\n7. segmentation_free: bool (default true)"
         }
        }
       }
      }
     }
    },
    "x-gradio-parameters": [
     {
      "name": "person_image",
      "schema": {
       "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"
           ]
          }
         }
        }
       }
      },
      "required": true,
      "default": null
     },
     {
      "name": "garment_image",
      "schema": {
       "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"
           ]
          }
         }
        }
       }
      },
      "required": true,
      "default": null
     },
     {
      "name": "category",
      "schema": {
       "type": "string",
       "enum": [
        "tops",
        "bottoms",
        "one-pieces"
       ]
      },
      "required": false,
      "default": "tops"
     },
     {
      "name": "garment_photo_type",
      "schema": {
       "type": "string",
       "enum": [
        "model",
        "flat-lay"
       ]
      },
      "required": false,
      "default": "model"
     },
     {
      "name": "num_timesteps",
      "schema": {
       "type": "number",
       "description": "numeric value between 10 and 50"
      },
      "required": false,
      "default": 50
     },
     {
      "name": "guidance_scale",
      "schema": {
       "type": "number",
       "description": "numeric value between 1.0 and 3.0"
      },
      "required": false,
      "default": 1.5
     },
     {
      "name": "seed",
      "schema": {
       "type": "integer"
      },
      "required": false,
      "default": 42
     },
     {
      "name": "segmentation_free",
      "schema": {
       "type": "boolean"
      },
      "required": false,
      "default": true
     }
    ],
    "operationId": "image_edit_virtual_try_on",
    "tags": [
     "Image editing"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ],
    "summary": "Virtual try-on (default): FASHN VTON 1.5 (972M, maskless)",
    "responses": {
     "200": {
      "description": "Job accepted.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "event_id"
         ],
         "properties": {
          "event_id": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/gradio_api/call/try_on/{event_id}": {
   "get": {
    "summary": "Read the result stream for /try_on",
    "description": "Server-sent events. The final `event: complete` carries a JSON array of outputs; `event: error` means the call failed.",
    "parameters": [
     {
      "name": "event_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "SSE stream",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    },
    "operationId": "image_edit_virtual_try_on_result",
    "tags": [
     "Image editing"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  }
 }
}