For a gallery built around CometAPI’s mj_turbo_upscale page, keep the original generation task reference attached to the selected image before offering an upscale action. The useful design decision is where that action belongs: on a selected Midjourney result, with its generation context still available.
The CometAPI model page describes post-processing of previously generated Midjourney images. Its specifications say the input typically includes a previous task reference and the selected image index from the original four-image grid. The integration example makes that relationship concrete through input.task_id and input.image_index, with 0 as the illustrative index.
CometAPI’s integration example shows a POST to https://api.cometapi.com/v1/images, with model: "mj-turbo-upscale" and those two fields nested under input. Treat this as the page’s documented request example, not a tested or complete API contract. For this CometAPI integration, the gallery-to-request mapping is the important part: the retained generation reference supplies input.task_id, while the saved image selection must be mapped to input.image_index after its accepted indexing convention is confirmed. An image file alone cannot supply that mapping.
That supports the following application design; these are recommendations, not additional API requirements:
- Retain the generation reference with the gallery result. Keep enough context to associate each selectable image with its original task, even after the user leaves the initial generation screen.
- Save the selection together with that reference. A thumbnail or exported image by itself does not carry the two request inputs shown in CometAPI’s example. Preserve the association when the user selects an option for enhancement.
- Offer upscaling from that selected result. If the task-to-image association is missing, recover it before offering this flow. Do not present an arbitrary file-upload control as supported on the strength of this example alone.
For example, a user might choose a composition from a generated grid, leave the gallery, and return later to prepare the selected image for delivery. The application should retain which generation and which selection that choice refers to. This makes the handoff from selection to CometAPI’s documented task-linked example explicit.
For the CometAPI upscale action, implement a pre-submit check that the selected gallery item still has its generation reference and saved selection. If either is missing, disable this task-linked action and ask for the original result to be selected again; do not substitute a file URL for input.task_id. This is a proposed application guard, not a claim about CometAPI’s server-side validation. It gives the integration a concrete boundary: restore the task-and-selection association before assembling the request shown on the page.
There are two implementation details to resolve before turning the example into a working request. First, an illustrative image_index: 0 does not establish the full accepted range or indexing convention; do not derive a UI-to-API index mapping from that single value. Second, the page heading uses mj_turbo_upscale, while the request example uses mj-turbo-upscale. Confirm the accepted API identifier rather than treating those spellings as interchangeable. This discussion is based on the page, without an executed API test.
The same boundary applies to output expectations. The overview mentions resolution doubling as general Midjourney context, which is insufficient to promise a fixed output size for this endpoint. Before delivery, check that the returned asset corresponds to the selected composition, inspect its actual dimensions, and review visual fidelity. Those are acceptance checks to perform, not results demonstrated here.
An arbitrary-image upload tool would need separate evidence for that input mode. This page does not establish such support, but that absence does not prove uploads are forbidden. For the workflow it does describe, preserving the task and selection together is the concrete prerequisite to design around.