
Build an Imagild progress card around the last observed task state, a durable operation ID, and a resumable status lookup. Show activity without inventing a completion percentage. The current task response supplies status and usage information, not a measured percent-complete or guaranteed finishing time.
Key Takeaways
- Keep editable draft settings separate from each submitted card's immutable identity.
- Ignore stale responses for a different operation or task.
- Stop local waiting without labeling the remote job canceled or automatically submitting again.
Let your backend own the API credential
The React client should call your authenticated application backend. That backend authorizes the user, loads the operation, and reads the known Imagild task using its server-held key.
The API console describes HTTP 202 acceptance and subsequent task reads. A 202 response should move the card to an accepted/waiting view, not to a completed image.
Persist the operation and task ID outside component memory. Reloading the page should recover the card from authorized backend state rather than mint a new generation key.
Use a reducer for observable transitions
React's useReducer reference describes pure state updates from actions. This illustrative reducer keeps status snapshots separate from local waiting and transport errors:
function taskCardReducer(state, action) {
if (action.operationId !== state.operationId) return state;
switch (action.type) {
case "accepted":
return { ...state, taskId: action.task.id,
snapshot: action.task, requestError: null };
case "snapshot":
if (action.task.id !== state.taskId) return state;
return { ...state, snapshot: action.task, requestError: null };
case "read-error":
return { ...state, requestError: action.message };
case "stop-waiting":
return { ...state, waiting: false };
case "resume-waiting":
return { ...state, waiting: true };
default:
return state;
}
}
Initialize each card with its own operation ID, optional saved task ID, snapshot, waiting flag, and error field. The reducer does not submit, poll, cancel, or store credentials. These action names belong to your UI, not the Imagild API status enum.
If an earlier request returns after the user opens a different card, the operation check prevents it from replacing the wrong card's state.
Render facts rather than simulated certainty
| Observed condition | Useful card content |
|---|---|
| Submission acknowledgment pending | “Submitting request” with saved local operation |
| Known nonterminal task | Status label, activity indicator, and last checked time |
| Status-read error | Last known task state plus a retry/check-access action |
succeeded | Open validated result through authorized media delivery |
failed | Sanitized error and usage state |
unknown | Reconciliation explanation and task reference |
An indeterminate animation can reassure the user that the interface is active. Do not slowly increment to “99%” unless a real measured progress contract supports it.
Use poll_after_seconds, currently five seconds, rather than a rapid render-driven loop. A local deadline should detach or pause waiting while retaining the operation.
Clean up polling without losing work
React's useEffect guidance explains cleanup when synchronizing with an external system. Cancel timers and abort or ignore stale status requests when a card unmounts or changes identity.
That cleanup ends client activity. It does not establish remote generation cancellation or point release. Keep “Check existing task” available on return.
Do not trigger paid submission from a mount effect that may rerun. A deliberate user approval should create or retrieve the server operation first; subsequent effects only read its state.
Make the budget and result boundary visible
The current model market image schedule is 10 points at 1K, 15 at 2K, and 20 at 4K. Show the submitted quote and actual usage.state without interpreting every network error as a refund. Active membership remains required for API access.
Use the failed-job guide for recovery copy and the poster versus first-frame guide for video cards. A truthful progress card explains what is known, preserves paid intent, and lets the user resume instead of starting over.
Related tasks
- What Should You Check Before Retrying a Failed Image or Video Job?
- Why Does a Video Card Show a Black Image Before Playback?
Sources and scope
- Imagild API console: Async acceptance, status/usage fields and active account access.
- Imagild model market: Current image point schedule displayed before and after submission.
- React useReducer: Pure action-based reducer updates for component state.
- React useEffect: Cleanup and synchronization with external polling requests/timers.
Product instructions were checked against the current Imagild API contract and the public model catalog. Code, budgets and acceptance checks are illustrative; this article does not claim a new paid generation test, an uptime measurement, a search-volume study or a ranking of AI citations.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: Original Imagild product screenshot captured on 28 October 2026; model availability and prices may change. This image is not an API response or a performance benchmark.