Workflow APIs allow you to create sophisticated video transformations by applying multi-step processing pipelines to your images.
There are several workflow templates available:
Astronaut/Space Theme Templates:
sch_microgravity_1025 - Transforms person into astronaut in microgravity scenesch_spacejump_1025 - Creates space jump scene with astronaut suit transformationsch_moonwalk_1025 - Simulates moonwalk on lunar surface with astronaut suitsch_raiseflag_1025 - Ceremonial flag planting on lunar surfaceEach template follows a specific processing pipeline with steps like:
import requests
import json
BASE_URL = 'https://api.vimmerse.net'
url = f"{BASE_URL}/workflow"
headers = {
'X-Api-Key': 'YOUR_API_KEY',
}
# Prepare options for overlay video template
options = {
"background_urls": "https://example.com/background1.mp4,https://example.com/background2.mp4",
"prompt": "Person is joyfully smiling and walking backward while still looking forward.",
"motion_type": "Auto"
}
payload = {
"title": "My Workflow Video",
"description": "Animated overlay video",
"template_id": "overlay_gray_5443",
"options": json.dumps(options),
"visibility_status": "1"
}
# If uploading image files
files = {
'image_files': ('image.png', open('path/to/image.png', 'rb'), 'image/png')
}
# Or provide image URLs
payload["image_urls"] = ["https://example.com/image.png"]
try:
response = requests.post(url, headers=headers, data=payload, files=files)
print(response.text)
response_data = response.json()
workflow_data = response_data['data']
workflow_id = workflow_data.get("id")
print(f"Workflow created with ID: {workflow_id}")
except Exception as e:
print(f"Workflow creation failed: {e}")
import time
while True:
response = requests.get(f"{BASE_URL}/workflow/{workflow_id}", headers=headers)
workflow_data = response.json().get('data')
processing_status = workflow_data.get("processing_status")
progress_percentage = workflow_data.get("progress_percentage")
print(f"Status: {processing_status}, Progress: {progress_percentage}%")
if processing_status in ['success', 'fail']:
break
time.sleep(20) # Wait before checking again
# Download results when complete
if processing_status == 'success':
for result_item in workflow_data.get('result', []):
video_url = result_item['url']
print(f"Download video from: {video_url}")
overlay_gray_5442 - Basic overlay with grayscale background
{
"template_id": "overlay_gray_5442",
"options": {
"background_urls": "video1.mp4,video2.mp4",
"prompt": "Describe the motion",
"motion_type": "Auto"
}
}
overlay_gray_5443 - Overlay with upscaling (recommended)
{
"template_id": "overlay_gray_5443",
"options": {
"background_urls": "video1.mp4",
"prompt": "Person walking forward smiling",
"motion_type": "Auto"
}
}
overlay_only_1025 - Simple overlay
{
"template_id": "overlay_only_1025",
"options": {
"video_urls": "already-animated.mp4",
"background_urls": "background1.mp4,background2.mp4"
}
}
New Media
Insufficient Credit
Not Found
Validation Error
{- "data": {
- "id": "workflow-id-12345",
- "title": "My Animated Video",
- "description": "Animated overlay video with background",
- "visibility_status": "1",
- "model": "overlay_gray_5443",
- "options": {
- "prompt": "Person is joyfully smiling and walking backward",
- "motion_type": "Auto",
- "duration": 5,
- "last_frame_support": true
}, - "primary_user_id": "user@example.com",
- "customer_id": "customer-id",
- "processing_status": "success",
- "progress_percentage": 100,
- "completions": [
- {
- "result": [
], - "flow": "crop_to_content"
}, - {
- "result": [
], - "flow": "replace_alpha_with_gray"
}, - {
- "result": [
], - "flow": "upscale"
}, - {
- "result": [
], - "flow": "create_media"
}, - {
- "result": [
], - "flow": "video_overlay"
}
], - "result": [
], - "media_result": [
- {
- "updated_at": "2025-04-11 18:42:51+00:00",
- "size": 411634,
}
], - "created_at": "2025-04-11 18:33:59.780864+00:00",
- "updated_at": "2025-04-11 18:43:47.510893+00:00"
}
}Workflow Object
Not Found
Validation Error
{- "data": {
- "id": "workflow-id-12345",
- "title": "My Animated Video",
- "description": "Animated overlay video with background",
- "visibility_status": "1",
- "model": "overlay_gray_5443",
- "options": {
- "prompt": "Person is joyfully smiling and walking backward",
- "motion_type": "Auto",
- "duration": 5,
- "last_frame_support": true
}, - "primary_user_id": "user@example.com",
- "customer_id": "customer-id",
- "processing_status": "success",
- "progress_percentage": 100,
- "completions": [
- {
- "result": [
], - "flow": "crop_to_content"
}, - {
- "result": [
], - "flow": "replace_alpha_with_gray"
}, - {
- "result": [
], - "flow": "upscale"
}, - {
- "result": [
], - "flow": "create_media"
}, - {
- "result": [
], - "flow": "video_overlay"
}
], - "result": [
], - "media_result": [
- {
- "updated_at": "2025-04-11 18:42:51+00:00",
- "size": 411634,
}
], - "created_at": "2025-04-11 18:33:59.780864+00:00",
- "updated_at": "2025-04-11 18:43:47.510893+00:00"
}
}Update a workflow. You can update one or more of the following fields:
Updated Workflow Object
Bad Request
Not Found
Validation Error
{- "data": {
- "id": "workflow-id-12345",
- "title": "My Animated Video",
- "description": "Animated overlay video with background",
- "visibility_status": "1",
- "model": "overlay_gray_5443",
- "options": {
- "prompt": "Person is joyfully smiling and walking backward",
- "motion_type": "Auto",
- "duration": 5,
- "last_frame_support": true
}, - "primary_user_id": "user@example.com",
- "customer_id": "customer-id",
- "processing_status": "success",
- "progress_percentage": 100,
- "completions": [
- {
- "result": [
], - "flow": "crop_to_content"
}, - {
- "result": [
], - "flow": "replace_alpha_with_gray"
}, - {
- "result": [
], - "flow": "upscale"
}, - {
- "result": [
], - "flow": "create_media"
}, - {
- "result": [
], - "flow": "video_overlay"
}
], - "result": [
], - "media_result": [
- {
- "updated_at": "2025-04-11 18:42:51+00:00",
- "size": 411634,
}
], - "created_at": "2025-04-11 18:33:59.780864+00:00",
- "updated_at": "2025-04-11 18:43:47.510893+00:00"
}
}Log customer script errors to S3. Errors are organized by customer_id and weekly period. Logs reset every week, with all errors for a week stored in a single file.
Request body should contain:
Error logged successfully
Bad Request
Validation Error
{- "data": {
- "message": "Error logged successfully",
- "log_path": "customer-error-logs/customer_id/errors-2024-W15.log",
}
}