fix(cli): resolve backend config access and prompt compiler initialization
- Fix PromptCompiler to receive full Storyboard object instead of GlobalStyle - Fix backend config access from app_config.backend to app_config.get_backend(backend) - Add proper error handling for backend configuration retrieval - Add templates/storyboard.json for testing
This commit is contained in:
@@ -81,17 +81,25 @@ def generate(
|
|||||||
checkpoint_mgr = CheckpointManager(str(checkpoint_db))
|
checkpoint_mgr = CheckpointManager(str(checkpoint_db))
|
||||||
|
|
||||||
# Initialize components
|
# Initialize components
|
||||||
prompt_compiler = PromptCompiler(storyboard_data.project.global_style)
|
prompt_compiler = PromptCompiler(storyboard_data)
|
||||||
|
|
||||||
|
# Get backend config for shot planner
|
||||||
|
try:
|
||||||
|
backend_config = app_config.get_backend(backend)
|
||||||
|
max_chunk_duration = backend_config.max_chunk_seconds or 6.0
|
||||||
|
except Exception:
|
||||||
|
max_chunk_duration = 6.0
|
||||||
|
|
||||||
shot_planner = ShotPlanner(
|
shot_planner = ShotPlanner(
|
||||||
fps=storyboard_data.project.fps or 24,
|
fps=storyboard_data.project.fps or 24,
|
||||||
max_chunk_duration=app_config.backend.max_chunk_seconds or 6.0
|
max_chunk_duration=max_chunk_duration
|
||||||
)
|
)
|
||||||
|
|
||||||
# Initialize generation backend
|
# Initialize generation backend
|
||||||
if not skip_generation:
|
if not skip_generation:
|
||||||
console.print(f"[bold blue]Initializing {backend} backend...[/bold blue]")
|
console.print(f"[bold blue]Initializing {backend} backend...[/bold blue]")
|
||||||
try:
|
try:
|
||||||
backend_config = app_config.get_backend_config(backend)
|
backend_config = app_config.get_backend(backend)
|
||||||
video_backend = BackendFactory.create_backend(backend, backend_config)
|
video_backend = BackendFactory.create_backend(backend, backend_config)
|
||||||
console.print(f"[green]✓[/green] Backend initialized: {backend}")
|
console.print(f"[green]✓[/green] Backend initialized: {backend}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
95
templates/storyboard.json
Normal file
95
templates/storyboard.json
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
"schema_version": "1.0",
|
||||||
|
"project": {
|
||||||
|
"title": "My Video",
|
||||||
|
"fps": 24,
|
||||||
|
"target_duration_s": 20,
|
||||||
|
"resolution": {
|
||||||
|
"width": 1920,
|
||||||
|
"height": 1080
|
||||||
|
},
|
||||||
|
"aspect_ratio": "16:9",
|
||||||
|
"global_style": {
|
||||||
|
"visual_style": "cinematic, high detail, realistic lighting",
|
||||||
|
"color_grade": "teal and orange",
|
||||||
|
"lens": "35mm",
|
||||||
|
"lighting": "soft key light, practicals",
|
||||||
|
"motion_style": "smooth camera motion",
|
||||||
|
"negative_prompt": "blurry, low quality, watermark, text, logo, distorted faces"
|
||||||
|
},
|
||||||
|
"audio": {
|
||||||
|
"add_music": false,
|
||||||
|
"music_path": "",
|
||||||
|
"add_voiceover": false,
|
||||||
|
"voiceover_path": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"characters": [
|
||||||
|
{
|
||||||
|
"id": "char_001",
|
||||||
|
"name": "Protagonist",
|
||||||
|
"description": "Age, clothing, distinctive features",
|
||||||
|
"consistency_notes": "Keep outfit consistent across shots."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"locations": [
|
||||||
|
{
|
||||||
|
"id": "loc_001",
|
||||||
|
"name": "Neon Street",
|
||||||
|
"description": "Rainy neon-lit street at night, reflections on pavement"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"shots": [
|
||||||
|
{
|
||||||
|
"id": "S01_SH01",
|
||||||
|
"duration_s": 4,
|
||||||
|
"location_id": "loc_001",
|
||||||
|
"characters": ["char_001"],
|
||||||
|
"prompt": "Wide establishing shot of the neon street at night, rain, reflections on pavement.",
|
||||||
|
"camera": {
|
||||||
|
"framing": "wide",
|
||||||
|
"movement": "slow dolly forward",
|
||||||
|
"notes": "steady, cinematic"
|
||||||
|
},
|
||||||
|
"generation": {
|
||||||
|
"seed": 12345,
|
||||||
|
"steps": 30,
|
||||||
|
"cfg_scale": 6.0,
|
||||||
|
"sampler": "default",
|
||||||
|
"chunk_seconds": 4,
|
||||||
|
"use_init_frame_from_prev": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "S01_SH02",
|
||||||
|
"duration_s": 5,
|
||||||
|
"location_id": "loc_001",
|
||||||
|
"characters": ["char_001"],
|
||||||
|
"prompt": "Medium shot: protagonist in a yellow coat walks past storefronts, raindrops visible in the light.",
|
||||||
|
"camera": {
|
||||||
|
"framing": "medium",
|
||||||
|
"movement": "handheld follow",
|
||||||
|
"notes": "subtle shake, not chaotic"
|
||||||
|
},
|
||||||
|
"generation": {
|
||||||
|
"seed": 12346,
|
||||||
|
"steps": 30,
|
||||||
|
"cfg_scale": 6.0,
|
||||||
|
"sampler": "default",
|
||||||
|
"chunk_seconds": 5,
|
||||||
|
"use_init_frame_from_prev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"output": {
|
||||||
|
"container": "mp4",
|
||||||
|
"codec": "h264",
|
||||||
|
"crf": 18,
|
||||||
|
"preset": "medium",
|
||||||
|
"upscale": {
|
||||||
|
"enabled": false,
|
||||||
|
"target_height": 2160,
|
||||||
|
"method": "default"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user