Segmind Double Capsule Serverless API
Re-shoot footage you already have. Give Segmind Double Capsule a clip, a reference image and one sentence, and get the same take in a new location, light or season, or with a swapped prop. Seedance 2.5 edit keeps the performance and camera move. 10-bit, at your clip's exact length.
1import requests
2import time
3import json
4
5api_key = "YOUR_API_KEY"
6url = "https://api.segmind.com/workflows/v2/6ae2ede23d93ec299cd95e70-v4"
7
8data = {
9 "source_video": "https://images.segmind.com/public/01ee3fbafb4860ea4c64322c0e096e81.mp4",
10 "reference_image": "https://images.segmind.com/public/baba54a04431418c3865228d4c6377c6.jpeg",
11 "change": "Change the setting and the light to the back room of the 1920s jazz club in @Image 1: blue haze, warm brass table lamps; keep his cigarette smoke",
12 "keep": "the man in a white shirt, tie and suspenders",
13 "smooth_retime_and_grain_match": true
14}
15
16def poll_for_result(poll_url):
17 """Poll the API until the generation is complete"""
18 while True:
19 response = requests.get(
20 poll_url,
21 headers={'x-api-key': api_key}
22 )
23 result = response.json()
24
25 if result['status'] == 'COMPLETED':
26 # Parse the output (it's a JSON string)
27 outputs = json.loads(result['output'])
28 return outputs
29 elif result['status'] == 'FAILED':
30 raise Exception(result.get('error', 'Generation failed'))
31
32 # Wait 7 seconds before polling again
33 time.sleep(7)
34
35# Make the initial request
36response = requests.post(
37 url,
38 json=data,
39 headers={
40 'x-api-key': api_key,
41 'Content-Type': 'application/json'
42 }
43)
44
45if response.status_code == 200:
46 result = response.json()
47 print('Request queued:', result)
48
49 # Start polling for results
50 outputs = poll_for_result(result['poll_url'])
51 print('Generation complete:', outputs)
52else:
53 print(f"Error: {response.status_code}")
54 print(response.text) 1import requests
2import time
3import json
4
5api_key = "YOUR_API_KEY"
6url = "https://api.segmind.com/workflows/v2/6ae2ede23d93ec299cd95e70-v4"
7
8data = {
9 "source_video": "https://images.segmind.com/public/01ee3fbafb4860ea4c64322c0e096e81.mp4",
10 "reference_image": "https://images.segmind.com/public/baba54a04431418c3865228d4c6377c6.jpeg",
11 "change": "Change the setting and the light to the back room of the 1920s jazz club in @Image 1: blue haze, warm brass table lamps; keep his cigarette smoke",
12 "keep": "the man in a white shirt, tie and suspenders",
13 "smooth_retime_and_grain_match": true
14}
15
16def poll_for_result(poll_url):
17 """Poll the API until the generation is complete"""
18 while True:
19 response = requests.get(
20 poll_url,
21 headers={'x-api-key': api_key}
22 )
23 result = response.json()
24
25 if result['status'] == 'COMPLETED':
26 # Parse the output (it's a JSON string)
27 outputs = json.loads(result['output'])
28 return outputs
29 elif result['status'] == 'FAILED':
30 raise Exception(result.get('error', 'Generation failed'))
31
32 # Wait 7 seconds before polling again
33 time.sleep(7)
34
35# Make the initial request
36response = requests.post(
37 url,
38 json=data,
39 headers={
40 'x-api-key': api_key,
41 'Content-Type': 'application/json'
42 }
43)
44
45if response.status_code == 200:
46 result = response.json()
47 print('Request queued:', result)
48
49 # Start polling for results
50 outputs = poll_for_result(result['poll_url'])
51 print('Generation complete:', outputs)
52else:
53 print(f"Error: {response.status_code}")
54 print(response.text)API Endpoint
https://api.segmind.com/workflows/v2/6ae2ede23d93ec299cd95e70-v4Parameters
source_videooptionalstring (uri)Source Video
"https://images.segmind.com/public/01ee3fbafb4860ea4c64322c0e096e81.mp4"reference_imageoptionalstring (uri)Reference Image
"https://images.segmind.com/public/baba54a04431418c3865228d4c6377c6.jpeg"changeoptionalstringChange
"Change the setting and the light to the back room of the 1920s jazz club in @Image 1: blue haze, warm brass table lamps; keep his cigarette smoke"keepoptionalstringKeep
"the man in a white shirt, tie and suspenders"smooth_retime_and_grain_matchoptionalbooleanSmooth retime + grain match
trueResponse Format
Returns: Polling-based asynchronous response
Initial request returns a poll_url. Poll every 7 seconds until status is COMPLETED.
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Workflow not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out