Compare commits
2 commits
main
...
feature-br
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89ea8d1602 | ||
|
|
9f6100c12a |
7 changed files with 71 additions and 13 deletions
|
|
@ -57,6 +57,8 @@ class Config:
|
|||
SUPPORTED_IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.tif', '.webp', '.ico']
|
||||
MIN_IMAGE_RESOLUTION = (720, 720) # Minimum 720p
|
||||
SUPPORTED_ASPECT_RATIOS = ['16:9', '9:16']
|
||||
SUPPORTED_RESOLUTIONS = ['720p', '1080p']
|
||||
DEFAULT_RESOLUTION = '720p'
|
||||
|
||||
# Webhook Configuration
|
||||
WEBHOOK_URL = os.getenv('WEBHOOK_URL', 'https://hook.us1.make.celonis.com/8ri1h8b2he4wudp2jku69mgcxumzxf3v')
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ Jinja2==3.1.6
|
|||
MarkupSafe==3.0.3
|
||||
numpy==2.3.4
|
||||
packaging==25.0
|
||||
Pillow==10.1.0
|
||||
Pillow>=10.4.0
|
||||
priority==2.0.0
|
||||
proto-plus==1.26.1
|
||||
protobuf==4.25.8
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ def generate_video():
|
|||
return jsonify({'error': 'Invalid video_length_sec value - must be a number'}), 400
|
||||
|
||||
aspect_ratio = data.get('aspect_ratio', '16:9')
|
||||
resolution = data.get('resolution', '720p')
|
||||
person_generation = data.get('person_generation', 'dont_allow')
|
||||
seed = data.get('seed')
|
||||
# Handle empty seed values by setting to None
|
||||
|
|
@ -183,6 +184,7 @@ def generate_video():
|
|||
|
||||
print(f"DEBUG: Final video_length_sec value: {video_length_sec} (type: {type(video_length_sec)})")
|
||||
print(f"DEBUG: aspect_ratio: {aspect_ratio}")
|
||||
print(f"DEBUG: resolution: {resolution}")
|
||||
print(f"DEBUG: person_generation: {person_generation}")
|
||||
print(f"DEBUG: seed: {seed}")
|
||||
print(f"DEBUG: generate_audio: {generate_audio}")
|
||||
|
|
@ -198,6 +200,16 @@ def generate_video():
|
|||
except Exception as e:
|
||||
print(f"DEBUG: Error cleaning up image: {e}")
|
||||
return jsonify({'error': 'Invalid aspect ratio. Must be "16:9" or "9:16"'}), 400
|
||||
|
||||
# Validate resolution
|
||||
if resolution not in Config.SUPPORTED_RESOLUTIONS:
|
||||
if image_path and os.path.exists(image_path):
|
||||
try:
|
||||
os.remove(image_path)
|
||||
os.rmdir(os.path.join(Config.TEMP_DOWNLOAD_PATH, f"job_{job_id}"))
|
||||
except Exception as e:
|
||||
print(f"DEBUG: Error cleaning up image: {e}")
|
||||
return jsonify({'error': f'Invalid resolution. Must be one of: {", ".join(Config.SUPPORTED_RESOLUTIONS)}'}), 400
|
||||
|
||||
# Validate model selection
|
||||
if model_name and model_name not in Config.SUPPORTED_MODELS:
|
||||
|
|
@ -260,6 +272,7 @@ def generate_video():
|
|||
model_name=model_name,
|
||||
video_length_sec=video_length_sec,
|
||||
aspect_ratio=aspect_ratio,
|
||||
resolution=resolution,
|
||||
sample_count=sample_count,
|
||||
person_generation=person_generation,
|
||||
image_path=image_path,
|
||||
|
|
|
|||
|
|
@ -287,6 +287,7 @@ def generate_video_async(
|
|||
model_name: str = None,
|
||||
video_length_sec: int = 8,
|
||||
aspect_ratio: str = "16:9",
|
||||
resolution: str = "720p",
|
||||
sample_count: int = 1,
|
||||
person_generation: str = "dont_allow",
|
||||
image_path: str = None,
|
||||
|
|
@ -337,6 +338,7 @@ def generate_video_async(
|
|||
'model_name': model_name,
|
||||
'video_length_sec': video_length_sec,
|
||||
'aspect_ratio': aspect_ratio,
|
||||
'resolution': resolution,
|
||||
'person_generation': person_generation,
|
||||
'seed': seed,
|
||||
'generate_audio': generate_audio
|
||||
|
|
@ -366,6 +368,7 @@ def process_video_generation(job_id: str) -> None:
|
|||
model_name = job['model_name']
|
||||
video_length_sec = job['video_length_sec']
|
||||
aspect_ratio = job['aspect_ratio']
|
||||
resolution = job.get('resolution', '720p')
|
||||
sample_count = job['videos_requested']
|
||||
person_generation = job['person_generation']
|
||||
image_path = job['local_image_path']
|
||||
|
|
@ -621,6 +624,7 @@ def process_video_generation(job_id: str) -> None:
|
|||
config_kwargs = {
|
||||
'person_generation': person_generation,
|
||||
'aspect_ratio': aspect_ratio,
|
||||
'resolution': resolution,
|
||||
'output_gcs_uri': output_gcs_uri,
|
||||
'duration_seconds': video_length_sec,
|
||||
'generate_audio': generate_audio
|
||||
|
|
|
|||
32
frontend/package-lock.json
generated
32
frontend/package-lock.json
generated
|
|
@ -1918,7 +1918,8 @@
|
|||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/available-typed-arrays": {
|
||||
"version": "1.0.7",
|
||||
|
|
@ -1936,12 +1937,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.12.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz",
|
||||
"integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==",
|
||||
"version": "1.13.5",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.5.tgz",
|
||||
"integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.4",
|
||||
"follow-redirects": "^1.15.11",
|
||||
"form-data": "^4.0.5",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
|
|
@ -2137,6 +2139,7 @@
|
|||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
},
|
||||
|
|
@ -2309,6 +2312,7 @@
|
|||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
|
|
@ -2946,9 +2950,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
|
||||
"integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
|
||||
"integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
|
|
@ -3735,10 +3740,11 @@
|
|||
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
|
||||
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1"
|
||||
},
|
||||
|
|
@ -3887,6 +3893,7 @@
|
|||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
|
|
@ -3895,6 +3902,7 @@
|
|||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-db": "1.52.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ const VideoForm = ({ onSubmit, isGenerating, userJobs = [] }) => {
|
|||
prompt: '',
|
||||
video_length_sec: 8,
|
||||
aspect_ratio: '16:9',
|
||||
resolution: '720p',
|
||||
person_generation: 'allow_adult',
|
||||
model_name: 'veo-3.1-generate-preview',
|
||||
seed: '',
|
||||
|
|
@ -633,6 +634,32 @@ const VideoForm = ({ onSubmit, isGenerating, userJobs = [] }) => {
|
|||
</FormControl>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} sm={6}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel>Resolution</InputLabel>
|
||||
<Select
|
||||
value={formData.resolution}
|
||||
onChange={handleChange('resolution')}
|
||||
label="Resolution"
|
||||
>
|
||||
{VIDEO_GENERATION_OPTIONS.resolutions.map((option) => (
|
||||
<MenuItem key={option.value} value={option.value}>
|
||||
<Box>
|
||||
<Typography variant="body1">
|
||||
{option.label}
|
||||
{option.recommended && (
|
||||
<Typography component="span" variant="caption" color="primary" sx={{ ml: 1, fontWeight: 'bold' }}>
|
||||
RECOMMENDED
|
||||
</Typography>
|
||||
)}
|
||||
</Typography>
|
||||
</Box>
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} sm={6}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel>Person Generation</InputLabel>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ export const VIDEO_GENERATION_OPTIONS = {
|
|||
{ value: '16:9', label: '16:9 (Landscape)' },
|
||||
{ value: '9:16', label: '9:16 (Portrait)' }
|
||||
],
|
||||
resolutions: [
|
||||
{ value: '720p', label: '720p (Standard)', recommended: true },
|
||||
{ value: '1080p', label: '1080p (High Quality)' }
|
||||
],
|
||||
models: [
|
||||
// Veo 3.1 Models Only
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue