Aufgaben
Basis-URL: https://app.neuroflash.com/api/image-service
Bilder aus einer Textaufforderung generieren
POST
/v1/workspaces/{workspaceId}/image-generation-tasksGeneriert ein neues Bild aus der angegebenen Aufforderung.
Pfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workspaceId | string | Ja |
Anfrage-Body
FeldTypErforderlichBeschreibung
promptstringJaTextaufforderung für die GenerierungnumImagesintegerNeinAnzahl der zu generierenden BilderaspectRatiostringNeinSeitenverhältnisoptionen für generierte Bilder.outputFormatstringNeinmodelIdstringNeinVerfügbare Bildgenerierungsmodelle.Antwort
FeldTypBeschreibung
imagesarray<object>die erstellten Bilder
idstringeindeutige UUIDgenerationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.workspaceIdstringowning workspace IDcreatedByUserIdstringuserId of the account that created this imagepromptstringprompt that produced the image (empty for upscales or uploads)modelstringModell zur BildproduktionparametersobjectGenerierungsparameter (Seitenverhältnis, Format usw.)inputImageIdsobjectIDs von Eingabebildern für Bearbeitungs- oder HochskalierungsaufgabenfileNamestringBenutzerfreundlicher Dateiname (mit Erweiterung) geeignet für Downloads. Uploads tragen den vom Benutzer angegebenen Namen; Generierungen erhalten einen LLM-abgeleiteten Slug; Bearbeitungen/Hochskalierungen ergänzen den Namen der Eingabe. Maximal 50 Zeichen.imageWidthobjectBildbreite in PixelnimageHeightobjectBildhöhe in PixelnimageSizeobjectBilddateigröße in BytescreatedAtstringErstellungszeitstempel als ISO 8601updatedAtstringZeitstempel der letzten Aktualisierung als ISO 8601shareKeystringHMAC-Schlüssel zur Autorisierung des öffentlichen Freigabelinks dieses Bildes (als ?key= übergeben)_linksobject
contentstringTemporäre URL zur BilddateidownloadstringTemporäre URL, die einen Dateidownload erzwingt (content-disposition: attachment)generationIdstringID, die die zusammen erstellten Bilder gruppiertdescriptionstringoptionale Beschreibung vom Upstream-Anbieterdetailobjectnicht-fatale Warnung (z. B. teilweises Kontingent)Beispiel
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/image-generation-tasks" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"prompt": "string",
"numImages": 1,
"aspectRatio": "string",
"outputFormat": "string",
"modelId": "string"
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/image-generation-tasks",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"prompt": "string",
"numImages": 1,
"aspectRatio": "string",
"outputFormat": "string",
"modelId": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/image-generation-tasks`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "string",
"numImages": 1,
"aspectRatio": "string",
"outputFormat": "string",
"modelId": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"prompt": "string",
"numImages": 1,
"aspectRatio": "string",
"outputFormat": "string",
"modelId": "string",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/image-generation-tasks", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{
"images": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "string"
}
}
],
"generationId": "string",
"description": "string",
"detail": {}
}
Vorhandene Bilder bearbeiten (Prompt-gesteuerte Bild-zu-Bild-Bearbeitung)
POST
/v1/workspaces/{workspaceId}/image-edit-tasksNutzt ein oder mehrere vorhandene Bilder und einen Prompt und erzeugt neue, von ihnen abgeleitete Bilder.
Pfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workspaceId | string | Ja |
Anfrage-Body
FeldTypErforderlichBeschreibung
promptstringJaBearbeitungs-Prompt, der die Bild-zu-Bild-Generierung steuertimageIdsarray<string>JaIDs von vorhandenen Bildern zur Bearbeitung. Der Aufrufer muss jedes Bild besitzen (gleicher Arbeitsbereich und createdByUserId).numImagesintegerNeinAnzahl der zu produzierenden BilderaspectRatiostringNeinSeitenverhältnisoptionen einschließlich 'auto' für Bild-zu-Bild-Bearbeitungen.outputFormatstringNeinmodelIdstringNeinVerfügbare Bildgenerierungsmodelle.Antwort
FeldTypBeschreibung
imagesarray<object>die erstellten Bilder
idstringeindeutige UUIDgenerationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.workspaceIdstringowning workspace IDcreatedByUserIdstringuserId of the account that created this imagepromptstringprompt that produced the image (empty for upscales or uploads)modelstringModell zur BildproduktionparametersobjectGenerierungsparameter (Seitenverhältnis, Format usw.)inputImageIdsobjectIDs von Eingabebildern für Bearbeitungs- oder HochskalierungsaufgabenfileNamestringBenutzerfreundlicher Dateiname (mit Erweiterung) geeignet für Downloads. Uploads tragen den vom Benutzer angegebenen Namen; Generierungen erhalten einen LLM-abgeleiteten Slug; Bearbeitungen/Hochskalierungen ergänzen den Namen der Eingabe. Maximal 50 Zeichen.imageWidthobjectBildbreite in PixelnimageHeightobjectBildhöhe in PixelnimageSizeobjectBilddateigröße in BytescreatedAtstringErstellungszeitstempel als ISO 8601updatedAtstringZeitstempel der letzten Aktualisierung als ISO 8601shareKeystringHMAC-Schlüssel zur Autorisierung des öffentlichen Freigabelinks dieses Bildes (als ?key= übergeben)_linksobject
contentstringTemporäre URL zur BilddateidownloadstringTemporäre URL, die einen Dateidownload erzwingt (content-disposition: attachment)generationIdstringID, die die zusammen erstellten Bilder gruppiertdescriptionstringoptionale Beschreibung vom Upstream-Anbieterdetailobjectnicht-fatale Warnung (z. B. teilweises Kontingent)Beispiel
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/image-edit-tasks" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"prompt": "string",
"imageIds": [],
"numImages": 1,
"aspectRatio": "string",
"outputFormat": "string",
"modelId": "string"
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/image-edit-tasks",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"prompt": "string",
"imageIds": [],
"numImages": 1,
"aspectRatio": "string",
"outputFormat": "string",
"modelId": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/image-edit-tasks`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "string",
"imageIds": [],
"numImages": 1,
"aspectRatio": "string",
"outputFormat": "string",
"modelId": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"prompt": "string",
"imageIds": []any{},
"numImages": 1,
"aspectRatio": "string",
"outputFormat": "string",
"modelId": "string",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/image-edit-tasks", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{
"images": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "string"
}
}
],
"generationId": "string",
"description": "string",
"detail": {}
}
Vorhandenes Bild hochskalieren
POST
/v1/workspaces/{workspaceId}/image-upscale-tasksSkaliert ein einzelnes Eingabebild mit einem dedizierten Hochskalierungsmodell hoch.
Pfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workspaceId | string | Ja |
Anfrage-Body
FeldTypErforderlichBeschreibung
imageIdstringJaID des vorhandenen Bildes zum Hochskalieren. Der Aufrufer muss das Bild besitzen (gleicher Arbeitsbereich und createdByUserId).modelIdstringJaVerfügbare Bildhocskalierungsmodelle.upscaleFactorintegerJaUnterstützte Hochskalierungsfaktoren.outputFormatstringNeinAntwort
FeldTypBeschreibung
imagesarray<object>die erstellten Bilder
idstringeindeutige UUIDgenerationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.workspaceIdstringowning workspace IDcreatedByUserIdstringuserId of the account that created this imagepromptstringprompt that produced the image (empty for upscales or uploads)modelstringModell zur BildproduktionparametersobjectGenerierungsparameter (Seitenverhältnis, Format usw.)inputImageIdsobjectIDs von Eingabebildern für Bearbeitungs- oder HochskalierungsaufgabenfileNamestringBenutzerfreundlicher Dateiname (mit Erweiterung) geeignet für Downloads. Uploads tragen den vom Benutzer angegebenen Namen; Generierungen erhalten einen LLM-abgeleiteten Slug; Bearbeitungen/Hochskalierungen ergänzen den Namen der Eingabe. Maximal 50 Zeichen.imageWidthobjectBildbreite in PixelnimageHeightobjectBildhöhe in PixelnimageSizeobjectBilddateigröße in BytescreatedAtstringErstellungszeitstempel als ISO 8601updatedAtstringZeitstempel der letzten Aktualisierung als ISO 8601shareKeystringHMAC-Schlüssel zur Autorisierung des öffentlichen Freigabelinks dieses Bildes (als ?key= übergeben)_linksobject
contentstringTemporäre URL zur BilddateidownloadstringTemporäre URL, die einen Dateidownload erzwingt (content-disposition: attachment)generationIdstringID, die die zusammen erstellten Bilder gruppiertdescriptionstringoptionale Beschreibung vom Upstream-Anbieterdetailobjectnicht-fatale Warnung (z. B. teilweises Kontingent)Beispiel
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/image-upscale-tasks" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"imageId": "string",
"modelId": "string",
"upscaleFactor": 0,
"outputFormat": "string"
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/image-upscale-tasks",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"imageId": "string",
"modelId": "string",
"upscaleFactor": 0,
"outputFormat": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/image-upscale-tasks`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"imageId": "string",
"modelId": "string",
"upscaleFactor": 0,
"outputFormat": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"imageId": "string",
"modelId": "string",
"upscaleFactor": 0,
"outputFormat": "string",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/image-upscale-tasks", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Antwort:
{
"images": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "string"
}
}
],
"generationId": "string",
"description": "string",
"detail": {}
}