Fashion Fit Check Video Creation with Gemini Omni Flash Serverless API

Effortlessly create captivating fashion videos featuring high-quality visuals and audio with AI-driven tools.

 1import requests
 2import time
 3import json
 4
 5api_key = "YOUR_API_KEY"
 6url = "https://api.segmind.com/workflows/v2/6a86a3a9d4c1617922382868-v1"
 7
 8data = {
 9    "input_costume_image": "https://images.segmind.com/uploads/49409bc0-d819-4edf-8ca9-6197fefb5786/c31ab75f-8f29-491e-86b6-a8d566ccbdd4-Soft_Girl_Baddie_Floral_Corset_Top___.jpg",
10    "input_prompt": "Prompt - Create a premium commercial storyboard sheet for a food vlogger (from the image1 provided), she/he eating and reviewing about the food (from the image 2 provided) image in a clean A4 portrait layout. White background with (colour of the product image) branding, minimal editorial design, premium typography, and creative agency presentation style.",
11    "input_model_image": "https://images.segmind.com/uploads/49409bc0-d819-4edf-8ca9-6197fefb5786/02810785-149b-416b-8a39-1b7a333ca702-81386-output.jpg"
12}
13
14def poll_for_result(poll_url):
15    """Poll the API until the generation is complete"""
16    while True:
17        response = requests.get(
18            poll_url,
19            headers={'x-api-key': api_key}
20        )
21        result = response.json()
22
23        if result['status'] == 'COMPLETED':
24            # Parse the output (it's a JSON string)
25            outputs = json.loads(result['output'])
26            return outputs
27        elif result['status'] == 'FAILED':
28            raise Exception(result.get('error', 'Generation failed'))
29
30        # Wait 7 seconds before polling again
31        time.sleep(7)
32
33# Make the initial request
34response = requests.post(
35    url,
36    json=data,
37    headers={
38        'x-api-key': api_key,
39        'Content-Type': 'application/json'
40    }
41)
42
43if response.status_code == 200:
44    result = response.json()
45    print('Request queued:', result)
46
47    # Start polling for results
48    outputs = poll_for_result(result['poll_url'])
49    print('Generation complete:', outputs)
50else:
51    print(f"Error: {response.status_code}")
52    print(response.text)

API Endpoint

POSThttps://api.segmind.com/workflows/v2/6a86a3a9d4c1617922382868-v1

Parameters

input_costume_imageoptional
string (uri)

Input Costume Image

Default: "https://images.segmind.com/uploads/49409bc0-d819-4edf-8ca9-6197fefb5786/c31ab75f-8f29-491e-86b6-a8d566ccbdd4-Soft_Girl_Baddie_Floral_Corset_Top___.jpg"
input_promptoptional
string

Input Prompt

Default: "Prompt - Create a premium commercial storyboard sheet for a food vlogger (from the image1 provided), she/he eating and reviewing about the food (from the image 2 provided) image in a clean A4 portrait layout. White background with (colour of the product image) branding, minimal editorial design, premium typography, and creative agency presentation style."
input_model_imageoptional
string (uri)

Input Model Image

Default: "https://images.segmind.com/uploads/49409bc0-d819-4edf-8ca9-6197fefb5786/02810785-149b-416b-8a39-1b7a333ca702-81386-output.jpg"

Response 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.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Workflow not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out