Bildgenerierung
Basis-URL: https://app.neuroflash.com/api/ds-prototypes
Bildgenerierung ist im Pay-As-You-Go-Plan noch nicht verfĂŒgbar. Sie ist derzeit nur ĂŒber AbonnementplĂ€ne zugĂ€nglich, die Bildgenerierungs-Credits beinhalten.
Text2Image generierenâ
/Bilder aus Textaufforderungen generieren (Text-zu-Bild).
Anfrage-Bodyâ
promptstringJaDie Textaufforderung zur Bildgenerierungnum_imagesintegerNeinAnzahl der zu generierenden Bilderaspect_ratiostringNeinSeitenverhĂ€ltnisoptionen fĂŒr generierte Bilderoutput_formatstringNeinAusgabeformatoptionen fĂŒr generierte BildermodelobjectNeinDas Modell fĂŒr die Bildgenerierunglimit_generationsbooleanNeinAnzahl der Generierungen auf 1 begrenzenAntwortâ
imagesarray<object>Die generierten Bilder
urlstringDie URL, von der die Datei heruntergeladen werden kanncontent_typestringDer MIME-Typ der Dateifile_nameobjectDer Name der Dateifile_sizeobjectDie GröĂe der Datei in ByteswidthobjectDie Breite des BildesheightobjectDie Höhe des Bildesimage_idobjectDie eindeutige ID des Bildes im SpeicherdescriptionstringDie Beschreibung der generierten BilderpromptstringDer Prompt zur Generierung der BilderdetailobjectOptionale Detailmitteilung (z. B. Kontingentwarnung)batch_idobjectBatch-ID zum Gruppieren mehrerer Bilder aus einer GenerierungBeispielâ
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/ds-prototypes/" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"limit_generations": false
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/ds-prototypes/",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id, "Content-Type": "application/json"},
json={
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"limit_generations": False
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"x-workspace-id": workspaceId,
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"limit_generations": false
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": map[string]any{},
"limit_generations": false,
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/ds-prototypes/", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{
"images": [
{
"url": "string",
"content_type": "string",
"file_name": {},
"file_size": {},
"width": {},
"height": {},
"image_id": {}
}
],
"description": "string",
"prompt": "string",
"detail": {},
"batch_id": {}
}
Bild zu Bild generierenâ
/editBilder aus vorhandenen Bildern und Prompts generieren (Bild-zu-Bild).
Anfrage-Bodyâ
promptstringJaDer Prompt fĂŒr die Bildbearbeitungnum_imagesintegerNeinAnzahl der zu generierenden Bilderaspect_ratiostringNeinSeitenverhĂ€ltnisoptionen mit automatisch fĂŒr die Bildbearbeitungoutput_formatstringNeinAusgabeformatoptionen fĂŒr generierte BildermodelobjectNeinDas Modell fĂŒr die Bildgenerierungimage_urlsarray<string>JaRelative Pfade der Quellbilder, ĂŒbernommen aus dem output_image_url-Feld, das vom /history-Endpunkt zurĂŒckgegeben wird. Keine absoluten URLs ĂŒbergeben.limit_generationsbooleanNeinAnzahl der Generierungen auf 1 begrenzenAntwortâ
imagesarray<object>Die generierten Bilder
urlstringDie URL, von der die Datei heruntergeladen werden kanncontent_typestringDer MIME-Typ der Dateifile_nameobjectDer Name der Dateifile_sizeobjectDie GröĂe der Datei in ByteswidthobjectDie Breite des BildesheightobjectDie Höhe des Bildesimage_idobjectDie eindeutige ID des Bildes im SpeicherdescriptionstringDie Beschreibung der generierten BilderpromptstringDer Prompt zur Generierung der BilderdetailobjectOptionale Detailmitteilung (z. B. Kontingentwarnung)batch_idobjectBatch-ID zum Gruppieren mehrerer Bilder aus einer GenerierungBeispielâ
Das Feld image_urls erwartet den relativen Pfad, der im Feld output_image_url vom
/history-Endpunkt zurĂŒckgegeben wird â zum Beispiel /api/ds-prototypes/image_generation/{image_id}/view.
Konstruieren Sie keine absoluten URLs (z. B. https://app.neuroflash.com/api/...). Der Image-Service
löst diese Pfade intern auf und gibt bei einer externen URL einen 500-Fehler zurĂŒck.
Typischer Workflow:
- Bild mit
POST /erzeugen (Text-zu-Bild) output_image_urlausGET /historyabrufen- Diesen relativen Pfad in
image_urlsanPOST /editĂŒbergeben
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/ds-prototypes/edit" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"image_urls": ["/api/ds-prototypes/image_generation/YOUR_IMAGE_ID/view"],
"limit_generations": false
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/ds-prototypes/edit",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id, "Content-Type": "application/json"},
json={
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"image_urls": ["/api/ds-prototypes/image_generation/YOUR_IMAGE_ID/view"],
"limit_generations": False
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/edit`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"x-workspace-id": workspaceId,
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": {},
"image_urls": ["/api/ds-prototypes/image_generation/YOUR_IMAGE_ID/view"],
"limit_generations": false
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"prompt": "string",
"num_images": 1,
"aspect_ratio": "string",
"output_format": "string",
"model": map[string]any{},
"image_urls": []any{"/api/ds-prototypes/image_generation/YOUR_IMAGE_ID/view"},
"limit_generations": false,
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/ds-prototypes/edit", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{
"images": [
{
"url": "string",
"content_type": "string",
"file_name": {},
"file_size": {},
"width": {},
"height": {},
"image_id": {}
}
],
"description": "string",
"prompt": "string",
"detail": {},
"batch_id": {}
}
VerfĂŒgbare Modelle abrufenâ
/modelsListe der verfĂŒgbaren Bildgenerierungsmodelle abrufen.
Beispielâ
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/ds-prototypes/models" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/ds-prototypes/models",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/models`,
{ headers: { Authorization: `Bearer ${token}`, "x-workspace-id": workspaceId } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/ds-prototypes/models", nil)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
[
{
"id": "string",
"name": "string",
"provider": "string",
"description": "string",
"capabilities": [
"string"
],
"max_images": 0,
"aspect_ratios": [
"string"
],
"output_formats": [
"string"
],
"allowed": false,
"order": 0
}
]
Generierungsverlauf abrufenâ
/historyBildgenerierungsverlauf fĂŒr den Arbeitsbereich des authentifizierten Benutzers abrufen.
Abfrageparameterâ
| Parameter | Typ | Standard | Beschreibung |
|---|---|---|---|
model | string | â | |
limit | integer | 100 | |
offset | integer | 0 |
Beispielâ
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/ds-prototypes/history" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/ds-prototypes/history",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/history`,
{ headers: { Authorization: `Bearer ${token}`, "x-workspace-id": workspaceId } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/ds-prototypes/history", nil)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
[
{
"output_image_id": "string",
"batch_id": "string",
"user_id": 0,
"workspace_id": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"input_images": {},
"output_image_url": "/api/ds-prototypes/image_generation/b64b61f6-a7d2-4fa0-9f88-289dae46c41f/view",
"output_image_width": {},
"output_image_height": {},
"output_image_size": {},
"created_at": "2024-01-15T10:30:00Z"
}
]
Generierung nach ID abrufenâ
/history/{image_id}Eine bestimmte Generierung nach ihrer Bild-ID abrufen.
Pfadparameterâ
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
image_id | string | Ja |
Antwortâ
output_image_idstringbatch_idstringuser_idintegerworkspace_idstringpromptstringmodelstringparametersobjectinput_imagesobjectoutput_image_urlobjectoutput_image_widthobjectoutput_image_heightobjectoutput_image_sizeobjectcreated_atstringBeispielâ
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/ds-prototypes/history/{image_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/ds-prototypes/history/{image_id}",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/ds-prototypes/history/${imageId}`,
{ headers: { Authorization: `Bearer ${token}`, "x-workspace-id": workspaceId } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/ds-prototypes/history/"+imageID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{
"output_image_id": "string",
"batch_id": "string",
"user_id": 0,
"workspace_id": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"input_images": {},
"output_image_url": {},
"output_image_width": {},
"output_image_height": {},
"output_image_size": {},
"created_at": "2024-01-15T10:30:00Z"
}
Generierung löschenâ
/history/{image_id}Löschen Sie eine Generierung und das zugehörige Bild aus dem Speicher.
Pfadparameterâ
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
image_id | string | Ja |
Beispielâ
- cURL
- Python
- Node.js
- Go
curl -X DELETE "https://app.neuroflash.com/api/ds-prototypes/history/{image_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-workspace-id: YOUR_WORKSPACE_ID"
import requests
requests.delete(
f"https://app.neuroflash.com/api/ds-prototypes/history/{image_id}",
headers={"Authorization": f"Bearer {token}", "x-workspace-id": workspace_id},
)
await fetch(
`https://app.neuroflash.com/api/ds-prototypes/history/${imageId}`,
{
method: "DELETE",
headers: { Authorization: `Bearer ${token}`, "x-workspace-id": workspaceId },
}
);
req, _ := http.NewRequest("DELETE", "https://app.neuroflash.com/api/ds-prototypes/history/"+imageID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("x-workspace-id", workspaceID)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{}