> For the complete documentation index, see [llms.txt](https://on-premises.docs.hyper3d.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://on-premises.docs.hyper3d.ai/texture-generation/workflow.md).

# Workflow

The Rodin Texture Generation Workflow is designed to create detailed textures from reference images, involving multiple steps from fetching task details to confirming the final texture output.

{% @mermaid/diagram content="sequenceDiagram
participant User as User
participant TaskDetailAPI as Task Detail API
participant TextureAPI as Texture Generation API
participant UpdateAPI as Update API
participant ConfirmAPI as Confirm API

```
User->>TaskDetailAPI: GET /api/task/card/{uuid}
Note right of TaskDetailAPI: API: get_task_detail
TaskDetailAPI-->>User: Response with task details and images

alt Generate with Previous Images
    User->>TextureAPI: POST /api/task/rodin_texture with UUID, prompt, and filename
    Note right of TextureAPI: API: rodin_texture
    TextureAPI-->>User: Response with UUID and status
else Generate with New Images
    User->>TextureAPI: POST /api/task/rodin_texture with new image, UUID, and prompt
    TextureAPI-->>User: Response with texture task details
end

loop Query Task Status
    User->>TextureAPI: Connect Socket.IO
    TextureAPI-->>User: Status update via Socket.IO
end

alt Task Not Satisfactory
    User->>UpdateAPI: POST /api/task/rodin_update with UUID, new seed, and settings
    Note right of UpdateAPI: API: rodin_update
    UpdateAPI-->>User: Updated task initiated
    loop Query Updated Task Status
        User->>TextureAPI: Connect Socket.IO
        TextureAPI-->>User: Status update via Socket.IO
    end
end

User->>ConfirmAPI: POST /api/task/rodin_confirm with UUID, quality, and version
Note right of ConfirmAPI: API: rodin_confirm
ConfirmAPI-->>User: Final confirmation and subscription key
```

" %}

**Match Reference Images**

* **API Used**: [`get_task_detail`](/task/fetch-task-detail.md)
* **Purpose**: To fetch detailed information about a specific task, including status and reference images used in the task.
* **Process**:
  * The task UUID is sent to the Rodin task detail endpoint.
  * The response includes details about the task, such as reference images and their corresponding filenames.

**Generate with Previous Images**

* **API Used**: [`rodin_texture`](/texture-generation/rodin-texture.md)
* **Purpose**: To generate textures based on specific pre-uploaded reference images.
* **Process**:
  * Parameters including the task UUID, a prompt, and the filename of a pre-uploaded reference image are sent to the Rodin texture generation endpoint.
  * The API response includes a UUID for the generated texture and a status message indicating the initiation of the texture generation process.
* **Query Task Status**: Monitor the job status as detailed in the [Query Task Status ](/task/query-task-status.md)section to ensure smooth progression and successful execution of subsequent steps.

**Generate with New Images**

* **API Used**: [`rodin_texture`](/texture-generation/rodin-texture.md)
* **Purpose**: To generate textures using new images provided during the request.
* **Process**:
  * A new image file along with the task UUID and a prompt are sent to the Rodin texture generation endpoint.
  * The request is processed, and the API response includes details about the texture generation task.
* **Query Task Status**: Monitor the job status as detailed in the [Query Task Status ](/task/query-task-status.md)section to ensure smooth progression and successful execution of subsequent steps.

#### Redo (Optional)

* **API Used**: [`rodin_update`](/texture-generation/redo.md)
* **Purpose**: To update the texture generation task with new parameters such as a different seed or settings if the initial results are not satisfactory.
* **Process**:
  * The task UUID of the mesh generation task is used along with new parameters such as prompt and settings.
  * A POST request is sent to the Rodin update endpoint with the updated parameters.
* **Query Task Status**: Monitor the job status as detailed in the [Query Task Status ](/task/query-task-status.md)section to ensure smooth progression and successful execution of subsequent steps.

**Confirm**

* **API Used**: [`rodin_confirm`](/texture-generation/confirm.md)
* **Purpose**: To finalize and confirm the texture generation results.
* **Process**:
  * The task UUID and parameters such as the quality and version are specified.
  * A POST request is sent to the Rodin confirm endpoint with these parameters.
  * The response typically includes a job's subscription key, indicating that a final processing task has been initiated to finalize the textures.
* **Query Task Status**: Monitor the job status as detailed in the [Query Task Status ](/task/query-task-status.md)section to ensure smooth progression and successful execution of subsequent steps.
