Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
261 commits
Select commit Hold shift + click to select a range
5f72a6f
Remove redundant video copy to stitch subfolder
peteromallet Jun 4, 2025
aafe051
Update cleanup logic: Always remove stitch subfolder unless skip_clea…
peteromallet Jun 4, 2025
2258185
fix: Apply WGP frame quantization to guide video length calculation t…
peteromallet Jun 4, 2025
d9a4012
feat: Add steerable motion API and project settings update functionality
peteromallet Jun 4, 2025
4de8028
Fix: Handle missing fps_helpers in travel_stitch_task
peteromallet Jun 4, 2025
1dd3bc6
Inherit project_id for travel_orchestrator sub-tasks
peteromallet Jun 5, 2025
072caf7
Refactor headless server to exclusively use 'Queued' status for pendi…
peteromallet Jun 5, 2025
084edd5
Add SQLite WAL-aware polling to reduce task pickup latency - Added _w…
peteromallet Jun 5, 2025
26b357f
Apply changes to headless.py
peteromallet Jun 5, 2025
7cd07ba
Update SQLite output path formatting and unique naming
peteromallet Jun 5, 2025
8453587
fix: extract upscale_factor from full_orchestrator_payload in travel_…
peteromallet Jun 5, 2025
bfda954
feat: Add --booster_loras flag to apply quality-enhancing LoRAs
peteromallet Jun 5, 2025
2634c4c
feat: Add after_first_post_generation_brightness parameter
peteromallet Jun 5, 2025
c83668f
Fix: Correct frame calculation for travel segments
peteromallet Jun 6, 2025
c711ab2
fix(headless): Stitch multiple video segments from sliding window output
peteromallet Jun 6, 2025
0e26ad4
Remove frame quantization logic - use exact requested frame count
peteromallet Jun 6, 2025
7704573
fix: respect user-specified frame count in segment generation - segme…
peteromallet Jun 6, 2025
350a1ca
Refactor
peteromallet Jun 6, 2025
7a7678b
Refactor
peteromallet Jun 6, 2025
243d08b
Refactor: Reorganize file structure and update imports
peteromallet Jun 6, 2025
0dd0c27
Fix: Correct all remaining import errors after refactor
peteromallet Jun 6, 2025
f951d5d
Fix: Correct all import paths and function names
peteromallet Jun 6, 2025
7c74ce5
Fix: Correct ImportError and TypeError on init
peteromallet Jun 6, 2025
657c5bd
Fix: Add Wan2GP subdirectory to sys.path
peteromallet Jun 6, 2025
415c377
Fix: Correct final import errors in video_utils
peteromallet Jun 6, 2025
b548f25
Fix: Correct TypeError in get_oldest_queued_task
peteromallet Jun 6, 2025
c173e0c
Fix: Correct import errors in video_utils
peteromallet Jun 6, 2025
1f88e31
Fix(headless): Correct arguments for db_ops.update_task_status
peteromallet Jun 6, 2025
4729c02
Fix(deps): Remove circular import from sm_functions package
peteromallet Jun 6, 2025
652638d
Fix(travel): Correct UnboundLocalError for input_images_resolved_orig…
peteromallet Jun 6, 2025
9cb9bb5
Fix(travel): Correct arguments for create_guide_video_for_travel_segment
peteromallet Jun 6, 2025
81396b8
Fix(video_utils): Update create_guide_video_for_travel_segment signature
peteromallet Jun 6, 2025
bd28e42
Fix(travel): Correct keyword argument in create_guide_video call
peteromallet Jun 6, 2025
48a1fb0
Fix: Prioritize task settings over server flags
peteromallet Jun 6, 2025
c05a6fd
Fix: Apply color matching to all travel segments
peteromallet Jun 6, 2025
208b814
Fix: Download images for color matching and fix logging
peteromallet Jun 6, 2025
c853595
Fix NameError: Add missing import for sm_download_image_if_url in tra…
peteromallet Jun 6, 2025
89aad7a
Fix TypeError in travel_between_images.py
peteromallet Jun 6, 2025
2aabb5e
Fix TypeError for with_metadata in _apply_color_matching_to_video
peteromallet Jun 6, 2025
30727ba
Fix AttributeError for matched_video_path.exists
peteromallet Jun 6, 2025
247a9d4
feat: Update Wan2GP submodule to latest version
peteromallet Jun 7, 2025
4956b79
refactor: Overhaul headless server with orchestrators and improved DB…
peteromallet Jun 9, 2025
d6eebf3
fix: Resolve ImportError in sm_functions
peteromallet Jun 9, 2025
71f1155
Fix: Remove broken imports from sm_functions init
peteromallet Jun 9, 2025
9f49f97
Fix: Correct typo in generate_video function call
peteromallet Jun 9, 2025
1f741f6
Fix: Pass model_filename to wgp.py to prevent TypeError
peteromallet Jun 9, 2025
61f25d6
Fix: Pass logical model name to wgp.py to prevent crash
peteromallet Jun 9, 2025
d3f658f
Fix: Move model parameter to task params object where wgp.py expects it
peteromallet Jun 9, 2025
2568590
Temporarily remove Wan2GP submodule to reset its state
peteromallet Jun 9, 2025
24bdc13
Revert Wan2GP submodule to commit 026c2b0
peteromallet Jun 9, 2025
dc07127
Fix guide video length synchronization with generated video - Add fra…
peteromallet Jun 9, 2025
458e0e5
Fix(travel): Synchronize frame quantization and fix overlap IndexError
peteromallet Jun 9, 2025
638b058
Refactor(travel): Centralize frame quantization logic
peteromallet Jun 9, 2025
720c67c
Add CLI script add_task.py to enqueue tasks into database
peteromallet Jun 23, 2025
fe31554
Add mask-active-frames feature for travel between images
peteromallet Jun 23, 2025
a5c9e97
Fix mask video save location to match other videos
peteromallet Jun 23, 2025
a6c1f80
Fix stitch task UNIQUE constraint error
peteromallet Jun 23, 2025
d447477
Improve mask generation logic for travel segments
peteromallet Jun 23, 2025
d4fea60
Fix mask generation logic and add detailed debug logging
peteromallet Jun 23, 2025
dc8d2c0
Fix final frame masking logic for travel segments
peteromallet Jun 23, 2025
7b49a8f
Correct final frame masking for ALL travel segments
peteromallet Jun 23, 2025
23af617
Robust guide video overlap extraction
peteromallet Jun 23, 2025
fb88d04
Robust guide overlap extraction when OpenCV fails to report frame count
peteromallet Jun 23, 2025
1a98057
feat: Add detailed logging to guide video builder
peteromallet Jun 23, 2025
6ffb0e9
refactor: Plumb dprint through to video utils
peteromallet Jun 23, 2025
6a8b4c8
fix(travel): Set video_prompt_type for guide/mask usage
peteromallet Jun 23, 2025
704554f
Fix: Correct travel stitch logic and improve error handling
peteromallet Jun 23, 2025
90e8cad
Edge cases and test cases
peteromallet Jun 24, 2025
d1c5ff0
Add comprehensive test generator and implement continue-from-video fu…
peteromallet Jun 24, 2025
72520c0
Add delete db
peteromallet Jun 24, 2025
3fad6d6
Enable CausVid LoRA for all test tasks
peteromallet Jun 24, 2025
d7b0523
Add test results comparison functionality
peteromallet Jun 24, 2025
d642942
Fix comparison script to not regenerate tests
peteromallet Jun 24, 2025
e361efe
Add database-driven output collection and task monitoring
peteromallet Jun 24, 2025
07afdce
Make waiting for completion the default behavior
peteromallet Jun 24, 2025
e0e1fc4
Make enqueue+wait+compare the default behavior
peteromallet Jun 24, 2025
6866da6
Add comprehensive logging improvements and fix test generation
peteromallet Jun 24, 2025
ed8d95f
Make --save-logging filename optional with default
peteromallet Jun 24, 2025
6ea7f2f
Add --delete-db flag for fresh database starts
peteromallet Jun 24, 2025
aad281f
Fix logging conflict with numba by using stdout redirection
peteromallet Jun 24, 2025
a4a1f54
Update test generation: Add diverse task types with descriptive naming
peteromallet Jun 24, 2025
953fc68
Fix: ensure generate_single_video builds minimal state when caller om…
peteromallet Jun 24, 2025
ec54f25
Fix: (1) ensure generate_single_video promotes very small video_lengt…
peteromallet Jun 24, 2025
fc69a55
Fix single-frame video generation: preserve video_length=1 while bump…
peteromallet Jun 24, 2025
48d7ef4
Fix: build full task_state in generate_single_video to avoid list ind…
peteromallet Jun 24, 2025
06d6412
Fix CausVid headless crashes: enforce UI guard-rails upstream of WGP
peteromallet Jun 24, 2025
6049e3b
Add --task-type flag to generate_test_tasks.py allowing selective tas…
peteromallet Jun 24, 2025
17ac98d
Fix single_image handler: apply CausVid defaults to avoid single-fram…
peteromallet Jun 24, 2025
2804d8c
Fix: Default single_image tasks to t2v model
peteromallet Jun 24, 2025
7b300c8
feat: Redirect all output files to public/files directory
peteromallet Jun 24, 2025
e4812e5
fix: Update different_pose test task type to use orchestrator
peteromallet Jun 24, 2025
a488766
refactor: Ensure primitive tasks in a chain trigger next step
peteromallet Jun 24, 2025
8aca6ac
fix(common_utils): Allow negative frame indexing in save_frame_from_v…
peteromallet Jun 24, 2025
040b2ea
fix(headless): Ensure different_pose tasks chain correctly
peteromallet Jun 24, 2025
af81a0d
refactor: Improve different_pose workflow to use dependency-based tas…
peteromallet Jun 24, 2025
86448f3
fix: Replace OpenCV VideoWriter with FFmpeg for guide video creation
peteromallet Jun 24, 2025
67ad829
feat: Consolidate all task outputs into run-specific directories
peteromallet Jun 25, 2025
c74b6dc
fix(handlers): Allow generate_openpose to use task ID for input
peteromallet Jun 25, 2025
f42a4de
fix(headless): Restore correct wgp.generate_video call and file handling
peteromallet Jun 25, 2025
0063b08
feat: generalized mask video creation and integrate into travel_betwe…
peteromallet Jun 25, 2025
4b9725d
Refactor different_pose final generation to run inline via process_si…
peteromallet Jun 25, 2025
6b8e3f7
tests: keep artifacts for different_pose by setting debug_mode and sk…
peteromallet Jun 25, 2025
4c19e8d
Fix VACE ref processing: parse resolution correctly; add VACE image r…
peteromallet Jun 25, 2025
93433d3
Fix VACE image refs: convert string paths to PIL images before passin…
peteromallet Jun 25, 2025
abbfe5e
feat: fix VACE image reference handling and update STRUCTURE.md
peteromallet Jun 25, 2025
ace1030
fix: correct image_refs conversion logic
peteromallet Jun 25, 2025
671c1a2
More fixes
peteromallet Jun 25, 2025
2b1b6d9
More fixes
peteromallet Jun 25, 2025
23e8c32
feat: flatten SQLite file structure - all outputs now go directly to …
peteromallet Jun 25, 2025
05b3fea
fix: ensure all WGP outputs move to public/files for SQLite
peteromallet Jun 25, 2025
fc71d76
More fixes
peteromallet Jun 25, 2025
ae61429
fix: resolve database connection and NoneType iteration errors
peteromallet Jun 25, 2025
e93cc00
fix: resolve second NoneType iteration error in travel segment task h…
peteromallet Jun 25, 2025
67cb2e7
fix: resolve list index out of range error in CausVid LoRA processing
peteromallet Jun 25, 2025
2fe63dd
fix(video): Resolve video generation failure and fix headless server …
peteromallet Jun 25, 2025
187eb55
fix(video): resolve list index out of range error in LoRA processing
peteromallet Jun 25, 2025
e478f9f
why
peteromallet Jun 25, 2025
34d1e65
Add delete db
peteromallet Jun 25, 2025
72a34b9
feat: Add comprehensive debugging for WGP list index error
peteromallet Jun 25, 2025
70c4220
fix: Pass None instead of empty list for image_refs to prevent VAE en…
peteromallet Jun 25, 2025
487ac11
feat: LoRA enhancements
peteromallet Jun 25, 2025
21902e9
fix: guard against empty image_refs list causing VACE encode IndexError
peteromallet Jun 25, 2025
ecaba12
chore: apply Studio Ghibli LoRA to all single_image tests
peteromallet Jun 25, 2025
f6b3807
fix: flatten orchestrator_details in single_image handler to properly…
peteromallet Jun 26, 2025
438ca45
feat: fix CausVid parameter mapping in travel orchestrator
peteromallet Jun 26, 2025
7105c53
fix: update CausVid default param logic for travel segments
peteromallet Jun 26, 2025
d8c2754
feat: Add use_lighti2x_lora support with 5-step fast generation
peteromallet Jun 26, 2025
4ba6dfb
refactor: Extract shared components for LoRA handling to eliminate co…
peteromallet Jun 26, 2025
6da4669
fix: Correct use_lighti2x_lora flag propagation in travel segments
peteromallet Jun 26, 2025
3c8a776
feat: update Wan2GP submodule with debug logging for headless mode
peteromallet Jun 26, 2025
0b0f452
feat: update LightI2X LoRA settings - 4 steps, unipc sampler, denoise…
peteromallet Jun 26, 2025
1fe3733
feat: fix timestamp format for JavaScript compatibility
peteromallet Jun 26, 2025
01a6564
feat: Show input images banner overlay for travel segments
peteromallet Jun 26, 2025
8140657
fix: download banner images when show_input_images enabled
peteromallet Jun 26, 2025
9713a5b
fix: banner video saved with correct fps, duration, faststart
peteromallet Jun 26, 2025
02975c6
feat: banner overlay on final stitched video and stability wait util
peteromallet Jun 26, 2025
b2a3432
fix: use .w/.h attributes for MoviePy compatibility
peteromallet Jun 26, 2025
61de05f
fix: remove redundant banner overlay from stitch task - segments alre…
peteromallet Jun 26, 2025
8c2da01
fix: use consistent banner images (first/last) across all segments
peteromallet Jun 27, 2025
557ea75
fix: banner overlay shows consistent first/last journey images across…
peteromallet Jun 27, 2025
61827b5
Update
peteromallet Jun 30, 2025
5c73ad8
fix: add missing report_orchestrator_failure helper and CPU fallback …
peteromallet Jun 30, 2025
3e48b30
Fix timestamp
peteromallet Jun 30, 2025
365bfe6
feat: enhance orchestrator completion status logging in travel stitch…
peteromallet Jun 30, 2025
9ae5dff
fix: unify orchestrator task_id with DB row id
peteromallet Jun 30, 2025
9a927c2
fix: override orchestrator task_id before handler call
peteromallet Jun 30, 2025
5d3df1d
fix: set canonical task_id prior to orchestrator processing
peteromallet Jun 30, 2025
db262ed
feat: Add Supabase support to headless.py
peteromallet Jul 4, 2025
a49364b
feat: Add Supabase Storage upload functionality
peteromallet Jul 4, 2025
63e3892
feat: add --supabase-anon-key flag and use anon key for client creation
peteromallet Jul 4, 2025
0794c86
chore: remove automatic Supabase init/migration RPCs (table managed e…
peteromallet Jul 4, 2025
144fa9c
fix: graceful fallback when set_session fails; allow service/any JWT …
peteromallet Jul 4, 2025
54acdda
feat: implement generalized Supabase upload for all task types
peteromallet Jul 4, 2025
304cff5
chore: add Supabase auth role debug logging in upload_to_supabase_sto…
peteromallet Jul 4, 2025
f802999
fix: prefix storage object names with auth.uid() to satisfy default RLS
peteromallet Jul 4, 2025
635b676
feat: call Edge Function complete-task when marking tasks COMPLETE in…
peteromallet Jul 4, 2025
c2afd36
refactor: improve auth check debugging for Supabase uploads
peteromallet Jul 4, 2025
c4f0233
fix(headless): Correct Supabase client auth initialization to fix RLS…
peteromallet Jul 4, 2025
c62ae5a
fix(supabase): Refactor auth to correctly use PATs instead of session…
peteromallet Jul 4, 2025
8543204
fix(db): Use correct object path to get public URL after upload
peteromallet Jul 4, 2025
d035044
fix(upload): Remove redundant task ID folders in Supabase upload paths
peteromallet Jul 4, 2025
813935a
feat(supabase): Implement atomic file upload via edge function
peteromallet Jul 4, 2025
08a2604
feat: add create_task Edge Function and update STRUCTURE.md
peteromallet Jul 5, 2025
474a060
feat: use create-task Edge Function for task insertion with RPC fallback
peteromallet Jul 5, 2025
54b07b0
feat: fix Supabase Edge Function 403 error by conditionally sending p…
peteromallet Jul 6, 2025
1934c2c
fix: skip project_id in Edge Function payload to avoid JWT mismatch e…
peteromallet Jul 6, 2025
570e6cd
feat: use correct Supabase edge function URL (create_task) and update…
peteromallet Jul 6, 2025
59036ca
fix: include project_id in Edge payload and allow service_role tokens…
peteromallet Jul 6, 2025
fee441c
refactor: revert Edge function URL to 'create-task' slug to match dep…
peteromallet Jul 6, 2025
70130a2
refactor: generate UUID4 strings for task IDs to satisfy Postgres uui…
peteromallet Jul 6, 2025
9302f45
fix: download previous segment video when output_location is Supabase…
peteromallet Jul 6, 2025
5ba15da
fix: provide default image_download_dir for anchor image downloads
peteromallet Jul 6, 2025
04b2f2d
fix: add exception clause for outer try in get_completed_segment_outp…
peteromallet Jul 6, 2025
a30a046
fix: download remote segment videos in stitch task when paths are Sup…
peteromallet Jul 6, 2025
350364d
feat: Add comprehensive debug logging for stitch race condition diagn…
peteromallet Jul 6, 2025
c5e940c
fix: Move debug log line after variable definition
peteromallet Jul 6, 2025
23a56a2
feat: Stitch retry waits for expected segment count
peteromallet Jul 6, 2025
ca3117f
fix: Stitch path resolution handles 'files/' paths irrespective of DB…
peteromallet Jul 6, 2025
27c5c0f
fix: Fix critical syntax errors in stitch path resolution and databas…
peteromallet Jul 6, 2025
533e37b
debug: Add immediate debug output to identify stitch task database qu…
peteromallet Jul 6, 2025
a49ad6e
fix: Fix Supabase RPC fallback logic for missing function
peteromallet Jul 6, 2025
579682a
fix: Remove RPC dependency and use direct SELECT for Supabase stitch …
peteromallet Jul 6, 2025
6886c28
debug: Add comprehensive debug logging to Edge Function upload process
peteromallet Jul 6, 2025
b437b27
fix: Make stitch task return final video path for Edge Function upload
peteromallet Jul 6, 2025
1507c59
feat: Add comprehensive logging for stitch task frame counts, overlap…
peteromallet Jul 6, 2025
c98a992
fix(edge): Allow Edge Function to mark tasks Complete even if output_…
peteromallet Jul 6, 2025
0aa5a26
feat: Add comprehensive stitching debug output to identify 55-frame i…
peteromallet Jul 7, 2025
7607fee
fix: Ignore 'steps' and 'num_inference_steps' in params_json_str_over…
peteromallet Jul 7, 2025
2023d8b
fix: auto-sync num_inference_steps to requested video_length (frames …
peteromallet Jul 7, 2025
422fdfe
fix: Make video_length authoritative over num_inference_steps
peteromallet Jul 7, 2025
9145192
fix: Add comprehensive debug logging for CausVid steps logic
peteromallet Jul 7, 2025
1ce53e9
fix: make video_length authoritative for CausVid & LightI2X
peteromallet Jul 7, 2025
22b4640
fix: ensure video_length is authoritative for CausVid/LightI2X LoRAs
peteromallet Jul 7, 2025
706eeef
simplify: use one simple fix for video_length calculation
peteromallet Jul 7, 2025
c972775
feat: Add comprehensive debugging system for video generation pipeline
peteromallet Jul 7, 2025
2181605
fix: validate cached segment videos against orchestrator expected fra…
peteromallet Jul 7, 2025
c542dfa
chore: add detailed [OVERLAP DEBUG] logs in stitch task
peteromallet Jul 8, 2025
b8fcaab
fix: orchestrator now persists quantized frame counts to payload
peteromallet Jul 8, 2025
10f7c32
fix: correct indentation error in wgp_utils.py send_cmd_debug function
peteromallet Jul 8, 2025
a10389e
feat: add comprehensive debugging for orchestrator completion tracking
peteromallet Jul 8, 2025
a61f777
fix: Correct video stitching cross-fade logic
peteromallet Jul 8, 2025
684ebe9
feat: Edge Function now marks orchestrator complete when final task c…
peteromallet Jul 8, 2025
6fb4001
fix: Correct video stitching cross-fade logic to avoid frame duplication
peteromallet Jul 8, 2025
82f556b
feat: Add detailed debug logging and auto log saving\n\n- Add [MASK_D…
peteromallet Jul 8, 2025
5e3ffbd
feat: validate full download of previous segment videos and correct s…
peteromallet Jul 8, 2025
c5cb48a
fix: Add robust frame count handling for guide video creation
peteromallet Jul 8, 2025
4795103
refactor: Use known frame counts from orchestrator instead of unrelia…
peteromallet Jul 8, 2025
69e0400
fix: Fix indentation error in wgp_utils.py
peteromallet Jul 8, 2025
896a547
fix: Fix indentation error in wgp_utils.py
peteromallet Jul 8, 2025
6b577d2
feat: Remove verbose debug logging from segment stitching
peteromallet Jul 8, 2025
065a8cf
fix: resolve relative import error in video_utils.py guide video crea…
peteromallet Jul 8, 2025
8a75a53
feat(debug): respect global debug flag for cleanup
peteromallet Jul 8, 2025
ad19308
refactor(output): flatten artefact structure
peteromallet Jul 8, 2025
c66507f
fix(travel_stitch): remove duplicate overlap frames before cross-fade…
peteromallet Jul 8, 2025
f3a56da
feat: unified authentication across all Supabase edge functions
peteromallet Jul 10, 2025
b1c2878
fix: handle Personal Access Tokens (PATs) properly in headless worker
peteromallet Jul 10, 2025
dc0681b
fix: resolve database function overload ambiguity in claim_next_task
peteromallet Jul 10, 2025
b8493a0
debug: add detailed logging to claim_next_task for troubleshooting
peteromallet Jul 10, 2025
64a5a16
debug: add status enum debugging and improve UUID handling
peteromallet Jul 10, 2025
18ef617
fix: correct task claiming logic - user_id != project_id
peteromallet Jul 10, 2025
1472704
fix: implement proper user authorization for task claiming
peteromallet Jul 10, 2025
b245e0a
fix: unify JWT and PAT paths to use direct SQL queries
peteromallet Jul 10, 2025
499fbcf
fix: update service role path to claim tasks from any project
peteromallet Jul 10, 2025
a339175
fix: replace JOIN query with separate project lookup for task claiming
peteromallet Jul 10, 2025
c3091b4
debug: add comprehensive error handling and logging to task claiming
peteromallet Jul 10, 2025
00b290c
feat: fix PGRST203/PGRST116 RLS issues by using Edge Functions
peteromallet Jul 10, 2025
5df2d57
docs: update STRUCTURE.md for new Edge Function
peteromallet Jul 10, 2025
32d0d30
fix: correct Edge Function JOIN syntax for dependency checking
peteromallet Jul 10, 2025
2d7f2ad
Updates
peteromallet Jul 10, 2025
071e2a7
feat: Add get-completed-segments Edge Function to fix stitch RLS issu…
peteromallet Jul 10, 2025
ad892ad
fix: accept PAT tokens in get-completed-segments and disable JWT veri…
peteromallet Jul 10, 2025
2effb94
fix: pass project_id to get-completed-segments function
peteromallet Jul 10, 2025
0e4863e
docs(readme): simplify quick-start guide; focus on local vs Supabase …
peteromallet Jul 16, 2025
332ae74
feat: add --worker parameter for worker-specific logging
peteromallet Jul 23, 2025
47fd29d
fix: correct database function name from func_claim_task to func_clai…
peteromallet Jul 23, 2025
7c26290
feat: Complete Supabase Edge Function migration with dual authentication
peteromallet Jul 24, 2025
680d9c1
refactor: Organize tests and clean up repository structure
peteromallet Jul 24, 2025
672a52f
cleanup: Remove remaining RPC function references
peteromallet Jul 24, 2025
b3b1eec
cleanup: Remove all remaining RPC references from db_operations.py
peteromallet Jul 24, 2025
55e5dc2
cleanup: Final comprehensive RPC reference elimination
peteromallet Jul 24, 2025
e317043
fix: Add proper error handling for Edge Function failures
peteromallet Jul 24, 2025
0adc7e1
fix: resolve UUID casting issue in complete-task edge function
peteromallet Jul 24, 2025
8f904e3
fix: Correct syntax error in db_operations.py line 541
peteromallet Jul 24, 2025
20818c7
fix: Change worker log files to append instead of overwrite
peteromallet Jul 25, 2025
75cc7e4
chore: update Wan2GP submodule to commit 026c2b0cbb30cc5fadce937ce563…
peteromallet Jul 26, 2025
9d05b68
feat: Add magic_edit task type with Replicate Flux integration
peteromallet Jul 29, 2025
27f16b9
feat: remove causvid generation step overrides - removed causvid-spec…
peteromallet Jul 30, 2025
9d97084
feat: enhance LoRA download reliability with HuggingFace Hub integration
peteromallet Jul 30, 2025
73b7a8a
feat: add comprehensive LoRA file validation and integrity checking
peteromallet Jul 30, 2025
de4b9ca
Creates more instructional README with examples
Aug 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,20 @@ loras_i2v/
.env

_test*

*.db

# Test outputs and generated test files
test_outputs/
test_results_comparison/
tests/

# Task database files
tasks.db-shm
tasks.db-wal

# venv
venv/*
venv312/*
venv/
venv312/
1,741 changes: 1,303 additions & 438 deletions README.md

Large diffs are not rendered by default.

263 changes: 248 additions & 15 deletions STRUCTURE.md

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions add_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import argparse
import json
import sys
from pathlib import Path

# Ensure project source directory is on the import path
proj_root = Path(__file__).resolve().parent
if str(proj_root) not in sys.path:
sys.path.insert(0, str(proj_root))

from source import db_operations as db_ops
from source.common_utils import generate_unique_task_id as sm_generate_unique_task_id


def _load_params(param_arg: str) -> dict:
"""Load params from a JSON string or from a @file reference."""
if param_arg.startswith("@"):
file_path = Path(param_arg[1:]).expanduser()
if not file_path.exists():
raise FileNotFoundError(f"Params file not found: {file_path}")
with open(file_path, "r", encoding="utf-8") as fp:
return json.load(fp)
# Otherwise, treat as literal JSON string
return json.loads(param_arg)


def main() -> None:
parser = argparse.ArgumentParser(
"add_task – enqueue a task for the Wan2GP headless server"
)
parser.add_argument(
"--type",
required=True,
help="Task type string (e.g. travel_orchestrator, travel_segment, generate_openpose, …)",
)
parser.add_argument(
"--params",
required=True,
help="JSON string with task payload OR @<path-to-json-file>",
)
parser.add_argument(
"--dependant-on",
dest="dependant_on",
default=None,
help="Optional task_id that this new task depends on.",
)
args = parser.parse_args()

try:
payload_dict = _load_params(args.params)
except Exception as e:
print(f"[ERROR] Could not parse --params: {e}")
sys.exit(1)

# Auto-generate task_id if needed
if "task_id" not in payload_dict or not payload_dict["task_id"]:
payload_dict["task_id"] = sm_generate_unique_task_id(f"{args.type[:8]}_")
print(f"[INFO] task_id not supplied – generated: {payload_dict['task_id']}")

try:
db_ops.add_task_to_db(
task_payload=payload_dict,
task_type_str=args.type,
dependant_on=args.dependant_on,
)
print(f"[SUCCESS] Task {payload_dict['task_id']} ({args.type}) enqueued.")
except Exception as e_db:
print(f"[ERROR] Failed to enqueue task: {e_db}")
sys.exit(2)


if __name__ == "__main__":
main()
101 changes: 101 additions & 0 deletions check_loras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/usr/bin/env python3
"""
LoRA File Integrity Checker

This script checks LoRA files in common directories for corruption or size issues.
It can also clean up corrupted files if requested.

Usage:
python check_loras.py # Check all LoRA directories
python check_loras.py --fix # Check and remove corrupted files
python check_loras.py --dir /path/to/loras # Check specific directory
"""

import argparse
import sys
from pathlib import Path

# Add source directory to path to import common_utils
sys.path.append(str(Path(__file__).parent / "source"))
from common_utils import check_loras_in_directory

def main():
parser = argparse.ArgumentParser(description="Check LoRA file integrity")
parser.add_argument("--dir", type=str, help="Specific directory to check")
parser.add_argument("--fix", action="store_true", help="Remove corrupted files")
parser.add_argument("--verbose", "-v", action="store_true", help="Verbose output")

args = parser.parse_args()

# Default LoRA directories to check
default_dirs = [
"Wan2GP/loras",
"Wan2GP/loras_hunyuan",
"Wan2GP/loras_hunyuan_i2v",
"Wan2GP/loras_i2v",
"Wan2GP/loras_ltxv"
]

if args.dir:
dirs_to_check = [args.dir]
else:
dirs_to_check = default_dirs

total_checked = 0
total_valid = 0
total_invalid = 0

print("🔍 LoRA File Integrity Check")
print("=" * 50)

for lora_dir in dirs_to_check:
dir_path = Path(lora_dir)
print(f"\n📁 Checking directory: {dir_path}")

if not dir_path.exists():
print(f" ⚠️ Directory not found: {dir_path}")
continue

results = check_loras_in_directory(dir_path, fix_issues=args.fix)

if "error" in results:
print(f" ❌ Error: {results['error']}")
continue

total_checked += results["total_files"]
total_valid += results["valid_files"]
total_invalid += results["invalid_files"]

print(f" 📊 Files found: {results['total_files']}")
print(f" ✅ Valid: {results['valid_files']}")
print(f" ❌ Invalid: {results['invalid_files']}")

if results["invalid_files"] > 0:
print(f" 🚨 Issues found:")
for issue in results["issues"]:
print(f" {issue}")

if args.verbose:
print(f" 📋 Detailed results:")
for summary_line in results["summary"]:
print(f" {summary_line}")

print("\n" + "=" * 50)
print(f"📈 Summary:")
print(f" Total files checked: {total_checked}")
print(f" Valid files: {total_valid}")
print(f" Invalid files: {total_invalid}")

if total_invalid > 0:
print(f"\n💡 Found {total_invalid} corrupted files.")
if not args.fix:
print(" Run with --fix to automatically remove corrupted files.")
else:
print(" Corrupted files have been removed.")
sys.exit(1)
else:
print("\n🎉 All LoRA files are valid!")
sys.exit(0)

if __name__ == "__main__":
main()
7 changes: 0 additions & 7 deletions env.txt

This file was deleted.

Loading