# API Seedream 5.0 Pro Riferimento API completo per i modelli Seedream 5.0 Pro di ByteDance. ## Varianti del modello Questa API supporta due varianti del modello: | Modello | ID | Descrizione | |-------|-----|-------------| | **Seedream 5.0 Pro** | `seedream-v5.0-pro` | Generazione da testo a immagine di alta qualità | | **Seedream 5.0 Pro Edit** | `seedream-v5.0-pro-edit` | Editing di immagini con immagini di riferimento | ## Confronto rapido | Funzionalità | Seedream 5.0 Pro | Seedream 5.0 Pro Edit | |---------|------------------|-----------------------| | Input | Prompt di testo | Immagini + Prompt di testo | | Proporzioni | 8 opzioni | 8 opzioni | | Risoluzioni | 1K, 2K | 1K, 2K | | Input di immagini | No | Obbligatorio (1-10 immagini) | ### Proporzioni supportate `16:9`, `4:3`, `3:2`, `1:1`, `2:3`, `3:4`, `9:16`, `21:9` ## Seedream 5.0 Pro (da testo a immagine) ### Punto di accesso ``` POST /api/v1/image/task ``` ### Parametri della richiesta #### Obbligatori | Parametro | Tipo | Descrizione | |-----------|------|-------------| | `model_name` | string | Deve essere `"seedream-v5.0-pro"` | | `prompt` | string | Prompt per la generazione dell'immagine | | `resolution` | string | Risoluzione di output: `"1k"` o `"2k"` | | `width` | number | Valore della proporzione della larghezza (ad es. 16 per 16:9) | | `height` | number | Valore della proporzione dell'altezza (ad es. 9 per 16:9) | **Nota:** La proporzione larghezza:altezza deve essere una delle seguenti: `16:9`, `4:3`, `3:2`, `1:1`, `2:3`, `3:4`, `9:16`, `21:9` ### Esempio di richiesta ```javascript const response = await fetch('https://api.flaq.ai/api/v1/image/task', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ model_name: 'seedream-v5.0-pro', prompt: 'Editorial fashion portrait, soft window light, muted palette', resolution: '1k', width: 16, height: 9 }) }); const { data } = await response.json(); const taskId = data.task_id; // Poll for results const pollResponse = await fetch( `https://api.flaq.ai/api/v1/image/${taskId}`, { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } } ); const result = await pollResponse.json(); console.log(result.data.task_result.images[0].url); ``` ## Seedream 5.0 Pro Edit (Editing di immagini) ### Punto di accesso ``` POST /api/v1/image/task ``` ### Parametri della richiesta #### Obbligatori | Parametro | Tipo | Descrizione | |-----------|------|-------------| | `model_name` | string | Deve essere `"seedream-v5.0-pro-edit"` | | `prompt` | string | Descrizione delle modifiche desiderate | | `image_url_list` | string[] | Array di URL delle immagini da modificare (1-10 immagini) | | `resolution` | string | Risoluzione di output: `"1k"` o `"2k"` | | `width` | number | Valore della proporzione della larghezza (ad es. 16 per 16:9) | | `height` | number | Valore della proporzione dell'altezza (ad es. 9 per 16:9) | **Nota:** La proporzione larghezza:altezza deve essere una delle seguenti: `16:9`, `4:3`, `3:2`, `1:1`, `2:3`, `3:4`, `9:16`, `21:9` **Nota sulla fatturazione:** A partire dalla seconda immagine di riferimento, ogni immagine aggiuntiva viene fatturata alla tariffa fissa configurata per immagine. ### Esempio di richiesta ```javascript const response = await fetch('https://api.flaq.ai/api/v1/image/task', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ model_name: 'seedream-v5.0-pro-edit', prompt: 'Change the hairstyle', image_url_list: [ 'https://img.bestimage.ai/test/2026/7/1/ad8e011a-3e9b-49f0-9397-282bf51e2e45_162640331.jpeg' ], resolution: '1k', width: 16, height: 9 }) }); const { data } = await response.json(); const taskId = data.task_id; // Poll for results const pollResponse = await fetch( `https://api.flaq.ai/api/v1/image/${taskId}`, { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } } ); const result = await pollResponse.json(); console.log(result.data.task_result.images[0].url); ``` ### Esempio di editing di una singola immagine ```javascript { model_name: 'seedream-v5.0-pro-edit', image_url_list: ['https://img.bestimage.ai/test/2026/7/1/ad8e011a-3e9b-49f0-9397-282bf51e2e45_162640331.jpeg'], prompt: 'Change the hairstyle', resolution: '1k', width: 16, height: 9 } ``` ### Esempio di editing di più immagini ```javascript { model_name: 'seedream-v5.0-pro-edit', image_url_list: [ 'https://example.com/image1.jpg', 'https://example.com/image2.jpg' ], prompt: 'Blend these images into a cohesive composition', resolution: '1k', width: 16, height: 9 } ``` ## Formato della risposta ### Risposta iniziale ```json { "code": 0, "message": "success", "data": { "task_id": "0ca5f379-327b-4d49-ba19-e38782ceb2f0", "response_url": "https://api.flaq.ai/api/v1/image/0ca5f379-327b-4d49-ba19-e38782ceb2f0", "task_status": "submitted" } } ``` ### Risposta del polling Esegui il polling di `GET /api/v1/image/{task_id}` per controllare lo stato: ```json { "code": 0, "data": { "task_id": "{task_id}", "task_status": "succeed", "task_status_msg": null, "response_url": "https://api.flaq.ai/api/v1/image/{task_id}", "task_result": { "credit": 0.09, "images": [ { "url": "https://example.com/generated-image.jpeg" } ] } }, "message": "success" } ``` ### Risposta di errore ```json { "code": 1201, "message": "[width, height] Invalid parameter (e.g. wrong key or value)", "data": null } ``` ### Valori di stato - `submitted`: Attività accettata - `processing`: Generazione dell'immagine in corso - `succeed`: Generazione dell'immagine completata - `failed`: Generazione dell'immagine non riuscita ## Tempo di elaborazione Tempo di elaborazione tipico: 15-60 secondi a seconda della complessità. ## Procedure consigliate 1. **Prompt dettagliati**: Prompt più descrittivi producono risultati migliori 2. **Proporzioni**: Prima della generazione, adatta le proporzioni al caso d'uso di destinazione 3. **Qualità dell'editing delle immagini**: Per l'editing, usa immagini sorgente ad alta risoluzione e ben illuminate