When an n8n workflow calls CometAPI’s image-generation endpoint, the image is not the same kind of data as the job metadata around it. Keep those responsibilities separate: let the job table track what was requested and where the finished asset lives, while binary storage holds the image itself.
The CometAPI image branch
The official CometAPI n8n guide sends the image request to:
https://api.cometapi.com/v1/images/generations
In the guide’s example, the response image is read from data[0].b64_json. That base64 value is the handoff point for the next n8n step—not a field to copy into a long-lived job row.
A practical branch is:
- Call CometAPI and confirm that the expected image data exists.
- Convert the base64 payload into an n8n binary item.
- Upload that binary item to object storage, such as S3 or Google Drive.
- Upsert the job record with the resulting file URL in
result_url. - Mark the job complete only after the storage step succeeds.
This keeps the record useful for orchestration: prompt or request metadata, status, timestamps, and result_url remain easy to query, while the potentially large image travels through a storage-oriented path.
Make the handoff explicit
Treat generation and upload as two different failure boundaries. If CometAPI returns an image but the upload fails, the job has not failed at generation; it has failed at persistence. Record that distinction and retry the upload according to the workflow’s policy instead of automatically requesting a second image. Otherwise a temporary storage problem can create duplicate creative outputs and make the job table misleading.
The guide’s example uses an image/png binary item, but a workflow should verify the actual format before assigning a MIME type or choosing a file extension. Model behavior and response support still need live verification for the model selected by the implementation; the documented endpoint and response field are not a promise that every image model behaves identically.
The result is a clean boundary for downstream creative work: CometAPI generates the image, n8n moves the binary asset to durable storage, and the job table records the reference that later steps can consume. The design is deliberately narrower than a claim about universal model support, storage performance, or cost savings—those require separate testing.