Compute Server Tasks
This document details the task types supported by the Compute Server and their parameters.
Overview
The Compute Server processes various AI tasks. Each task type has specific inputs and outputs.
flowchart TB
subgraph Backend ["Backend"]
API[Task Submission]
end
subgraph Compute ["Compute Server"]
Router[Task Router]
Queue[(Task Queue)]
end
subgraph Tasks ["Task Types"]
GEN[GENERATION]
EDIT[EDITING]
REF[REFINE]
VID[VIDEO]
BG[BACKGROUND_FIX]
FACE[FACE_ENHANCER]
IMG[IMAGE_ADJUSTER]
DET[DETAIL_ENHANCER]
end
API --> Router
Router --> Queue
Queue --> GEN
Queue --> EDIT
Queue --> REF
Queue --> VID
Queue --> BG
Queue --> FACE
Queue --> IMG
Queue --> DET
Task Types
| Task Type |
Purpose |
Primary Input |
GENERATION |
Create new images |
Prompt + references |
EDITING |
Composite/modify images |
Base image + references |
REFINE |
Upscale and enhance |
Base image |
VIDEO_GENERATION |
Create video |
Source image |
BACKGROUND_FIX |
Replace backgrounds |
Base image |
FACE_ENHANCER |
Improve faces |
Base image |
IMAGE_ADJUSTER |
Color/exposure adjustments |
Base image |
DETAIL_ENHANCER |
General enhancement |
Base image |
BACKGROUND_REMOVE |
Remove background |
Base image |
LLM_INTERACTION |
Text generation |
Prompt |
GENERATION Task
Creates new images from text prompts with optional reference inputs.
Parameters
| Parameter |
Type |
Required |
Description |
prompt |
string |
Yes |
Text description for generation |
width |
int |
No |
Output width (default: 1024) |
height |
int |
No |
Output height (default: 1024) |
seed |
int |
No |
Random seed for reproducibility |
subject_lora_weight |
float |
No |
Subject LoRA strength (0-1) |
product_lora_weight |
float |
No |
Product LoRA strength (0-1) |
style_lora_weight |
float |
No |
Style LoRA strength (0-1) |
product2_lora_weight |
float |
No |
Secondary product LoRA strength |
reference_image_url |
string |
No |
Reference image URL |
reference_image_strength |
float |
No |
Reference influence (0-1) |
provider_type |
string |
No |
Specific provider to use |
provider_config |
object |
No |
Provider-specific settings |
Example
{
"task_type": "GENERATION",
"prompt": "A woman wearing a blue summer dress, full body shot, studio lighting",
"width": 1024,
"height": 1536,
"seed": 42,
"subject_lora_weight": 0.8,
"product_lora_weight": 0.9,
"reference_image_url": "https://cdn.sartiq.com/products/...",
"reference_image_strength": 0.3
}
Output
{
"task_id": "uuid",
"status": "completed",
"result_image_url": "https://cdn.sartiq.com/generations/...",
"seed": 42,
"metadata": {
"model": "flux-dev",
"timing_ms": 8500
}
}
EDITING Task
Modifies existing images with garment placement or compositing.
Parameters
| Parameter |
Type |
Required |
Description |
base_image_url |
string |
Yes |
Image to edit |
reference_images |
array |
No |
Reference images for placement |
prompt |
string |
No |
Edit guidance |
mask_url |
string |
No |
Edit mask |
strength |
float |
No |
Edit strength (0-1) |
width |
int |
No |
Output width |
height |
int |
No |
Output height |
Example
{
"task_type": "EDITING",
"base_image_url": "https://cdn.sartiq.com/...",
"reference_images": [
{"url": "https://cdn.sartiq.com/products/...", "type": "garment"}
],
"prompt": "Place the dress naturally on the model",
"strength": 0.8
}
REFINE Task
Upscales and enhances image quality.
Parameters
| Parameter |
Type |
Required |
Description |
base_image_url |
string |
Yes |
Image to refine |
target_width |
int |
No |
Target output width |
target_height |
int |
No |
Target output height |
upscale_enabled |
bool |
No |
Enable upscaling |
upscale_factor |
float |
No |
Upscale multiplier (1-4) |
upscale_steps |
int |
No |
Upscale iterations |
upscale_denoise |
float |
No |
Denoise strength (0-1) |
upscale_prompt |
string |
No |
Upscale guidance |
face_detail_enabled |
bool |
No |
Enable face enhancement |
face_detail_steps |
int |
No |
Face enhancement iterations |
face_detail_denoise |
float |
No |
Face denoise strength |
face_detail_prompt |
string |
No |
Face enhancement guidance |
Example
{
"task_type": "REFINE",
"base_image_url": "https://cdn.sartiq.com/generations/...",
"target_width": 2048,
"target_height": 3072,
"upscale_enabled": true,
"upscale_factor": 2,
"upscale_steps": 20,
"upscale_denoise": 0.3,
"face_detail_enabled": true,
"face_detail_steps": 10,
"face_detail_denoise": 0.2
}
VIDEO_GENERATION Task
Creates video from static images.
Parameters
| Parameter |
Type |
Required |
Description |
base_image_url |
string |
Yes |
Source image |
motion_bucket_id |
int |
No |
Motion intensity (1-255) |
fps |
int |
No |
Frames per second |
duration |
float |
No |
Video duration in seconds |
seed |
int |
No |
Random seed |
Example
{
"task_type": "VIDEO_GENERATION",
"base_image_url": "https://cdn.sartiq.com/generations/...",
"motion_bucket_id": 127,
"fps": 24,
"duration": 3.0,
"seed": 42
}
Output
{
"task_id": "uuid",
"status": "completed",
"result_video_url": "https://cdn.sartiq.com/videos/..."
}
BACKGROUND_FIX Task
Replaces or fixes image backgrounds.
Parameters
| Parameter |
Type |
Required |
Description |
base_image_url |
string |
Yes |
Image to process |
background_prompt |
string |
No |
New background description |
background_image_url |
string |
No |
Background image to use |
mask_expansion |
int |
No |
Mask edge expansion pixels |
blend_strength |
float |
No |
Edge blending strength |
Example
{
"task_type": "BACKGROUND_FIX",
"base_image_url": "https://cdn.sartiq.com/...",
"background_prompt": "Clean white studio background with soft shadows"
}
FACE_ENHANCER Task
Enhances facial details in images.
Parameters
| Parameter |
Type |
Required |
Description |
base_image_url |
string |
Yes |
Image to enhance |
strength |
float |
No |
Enhancement strength (0-1) |
prompt |
string |
No |
Enhancement guidance |
preserve_identity |
bool |
No |
Preserve facial identity |
Example
{
"task_type": "FACE_ENHANCER",
"base_image_url": "https://cdn.sartiq.com/...",
"strength": 0.5,
"preserve_identity": true
}
IMAGE_ADJUSTER Task
Adjusts image color, exposure, and other properties.
Parameters
| Parameter |
Type |
Required |
Description |
base_image_url |
string |
Yes |
Image to adjust |
brightness |
float |
No |
Brightness adjustment (-1 to 1) |
contrast |
float |
No |
Contrast adjustment (-1 to 1) |
saturation |
float |
No |
Saturation adjustment (-1 to 1) |
warmth |
float |
No |
Color warmth (-1 to 1) |
prompt |
string |
No |
Adjustment guidance |
Example
{
"task_type": "IMAGE_ADJUSTER",
"base_image_url": "https://cdn.sartiq.com/...",
"brightness": 0.1,
"contrast": 0.05,
"saturation": -0.1
}
DETAIL_ENHANCER Task
General detail and quality enhancement.
Parameters
| Parameter |
Type |
Required |
Description |
base_image_url |
string |
Yes |
Image to enhance |
strength |
float |
No |
Enhancement strength (0-1) |
prompt |
string |
No |
Enhancement guidance |
preserve_original |
bool |
No |
Minimize changes |
BACKGROUND_REMOVE Task
Removes image background, outputs transparent PNG.
Parameters
| Parameter |
Type |
Required |
Description |
image_url |
string |
Yes |
Image to process |
output_format |
string |
No |
Output format (png, webp) |
LLM_INTERACTION Task
Text generation using language models.
Parameters
| Parameter |
Type |
Required |
Description |
prompt |
string |
Yes |
Text prompt |
system_prompt |
string |
No |
System instructions |
max_tokens |
int |
No |
Maximum output tokens |
temperature |
float |
No |
Randomness (0-2) |
Task Lifecycle
stateDiagram-v2
[*] --> PENDING: Created
PENDING --> QUEUED: Submitted
QUEUED --> PROCESSING: Worker picked up
PROCESSING --> COMPLETED: Success
PROCESSING --> FAILED: Error
PROCESSING --> CANCELLED: Cancelled
COMPLETED --> [*]
FAILED --> [*]
CANCELLED --> [*]
Status Values
| Status |
Description |
PENDING |
Task created, not yet queued |
QUEUED |
In queue, waiting for worker |
PROCESSING |
Being processed |
COMPLETED |
Successfully completed |
FAILED |
Failed with error |
CANCELLED |
Cancelled by user |
Error Handling
| Error Code |
Description |
Retry |
PROVIDER_TIMEOUT |
AI provider timed out |
Yes |
PROVIDER_ERROR |
AI provider returned error |
Yes |
INVALID_INPUT |
Input validation failed |
No |
CONTENT_POLICY |
Content policy violation |
No |
STORAGE_ERROR |
Failed to store result |
Yes |