(project_folder_path, launcher_json)
| 411 | |
| 412 | |
| 413 | def set_default_workflow_from_launcher_json(project_folder_path, launcher_json): |
| 414 | if not launcher_json: |
| 415 | return |
| 416 | workflow_json = launcher_json["workflow_json"] |
| 417 | with open( |
| 418 | os.path.join( |
| 419 | project_folder_path, "comfyui", "web", "scripts", "defaultGraph.js" |
| 420 | ), |
| 421 | "w", |
| 422 | ) as f: |
| 423 | f.write(f"export const defaultGraph = {json.dumps(workflow_json, indent=2)};") |
| 424 | |
| 425 | with open( |
| 426 | os.path.join( |
| 427 | project_folder_path, "comfyui", "custom_nodes", "ComfyUI-ComfyWorkflows", "current_graph.json" |
| 428 | ), |
| 429 | "w", |
| 430 | ) as f: |
| 431 | json.dump(workflow_json, f) |
| 432 | |
| 433 | |
| 434 | def get_launcher_state(project_folder_path): |
no outgoing calls
no test coverage detected