- id: generate_video_options
name: generate_video_options
tool: PYTHON_SANDBOX_RUN
input:
- name: script
value: |
import json
base_prompt = "A professional presentation of a new mobile app interface"
# Generate variations for A/B testing
variations = [
{
"name": "version_a_minimal",
"prompt": f"{base_prompt} with minimal design, clean white background, subtle animations",
"model": "ray-2",
"aspect_ratio": "16:9"
},
{
"name": "version_b_dynamic",
"prompt": f"{base_prompt} with dynamic camera movements, colorful gradient background, energetic transitions",
"model": "ray-flash-2",
"aspect_ratio": "16:9"
},
{
"name": "version_c_social",
"prompt": f"{base_prompt} optimized for social media, vertical format, engaging visual effects",
"model": "ray-2",
"aspect_ratio": "9:16"
}
]
print(json.dumps({"variations": variations}))
- id: create_version_a
name: create_version_a
tool: LUMA_TEXT_TO_VIDEO
config:
- name: api_key
value: "{{secrets.LUMA_API_KEY}}"
- name: model
value: "{{steps.generate_video_options.result.variations[0].model}}"
- name: aspect_ratio
value: "{{steps.generate_video_options.result.variations[0].aspect_ratio}}"
- name: duration
value: 10
input:
- name: prompt
value: "{{steps.generate_video_options.result.variations[0].prompt}}"
- id: create_version_b
name: create_version_b
tool: LUMA_TEXT_TO_VIDEO
config:
- name: api_key
value: "{{secrets.LUMA_API_KEY}}"
- name: model
value: "{{steps.generate_video_options.result.variations[1].model}}"
- name: aspect_ratio
value: "{{steps.generate_video_options.result.variations[1].aspect_ratio}}"
- name: duration
value: 10
input:
- name: prompt
value: "{{steps.generate_video_options.result.variations[1].prompt}}"
- id: analyze_results
name: analyze_results
tool: PYTHON_SANDBOX_RUN
input:
- name: script
value: |
import json
# Compile results
results = {
"version_a": {
"url": "{{steps.create_version_a.result.video_url}}",
"status": "{{steps.create_version_a.result.status}}",
"style": "minimal"
},
"version_b": {
"url": "{{steps.create_version_b.result.video_url}}",
"status": "{{steps.create_version_b.result.status}}",
"style": "dynamic"
}
}
print(json.dumps({"video_results": results}))