Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>ComfyUI Workflow</title> | |
| <style> | |
| body { | |
| font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; | |
| background-color: #1e1e1e; | |
| color: #d4d4d4; | |
| margin: 0; | |
| padding: 20px; | |
| line-height: 1.4; | |
| } | |
| .header { | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| color: white; | |
| padding: 20px; | |
| border-radius: 10px; | |
| margin-bottom: 20px; | |
| text-align: center; | |
| } | |
| .header h1 { | |
| margin: 0; | |
| font-size: 2em; | |
| } | |
| .header a { | |
| color: #ffffff; | |
| text-decoration: none; | |
| font-weight: bold; | |
| opacity: 0.9; | |
| } | |
| .header a:hover { | |
| opacity: 1; | |
| text-decoration: underline; | |
| } | |
| .json-container { | |
| background-color: #2d2d30; | |
| border-radius: 8px; | |
| padding: 20px; | |
| overflow-x: auto; | |
| border: 1px solid #3e3e42; | |
| } | |
| pre { | |
| margin: 0; | |
| white-space: pre-wrap; | |
| word-wrap: break-word; | |
| } | |
| .json-key { | |
| color: #9cdcfe; | |
| } | |
| .json-string { | |
| color: #ce9178; | |
| } | |
| .json-number { | |
| color: #b5cea8; | |
| } | |
| .json-boolean { | |
| color: #569cd6; | |
| } | |
| .json-null { | |
| color: #569cd6; | |
| } | |
| .copy-btn { | |
| background: #007acc; | |
| color: white; | |
| border: none; | |
| padding: 10px 20px; | |
| border-radius: 5px; | |
| cursor: pointer; | |
| margin-bottom: 10px; | |
| font-family: inherit; | |
| } | |
| .copy-btn:hover { | |
| background: #005a9e; | |
| } | |
| .download-btn { | |
| background: #28a745; | |
| color: white; | |
| border: none; | |
| padding: 10px 20px; | |
| border-radius: 5px; | |
| cursor: pointer; | |
| margin-bottom: 10px; | |
| margin-left: 10px; | |
| font-family: inherit; | |
| } | |
| .download-btn:hover { | |
| background: #218838; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="header"> | |
| <h1>ComfyUI Workflow</h1> | |
| <p>Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a></p> | |
| </div> | |
| <button class="copy-btn" onclick="copyToClipboard()">π Copy JSON</button> | |
| <button class="download-btn" onclick="downloadJSON()">πΎ Download JSON</button> | |
| <div class="json-container"> | |
| <pre id="json-content">{ | |
| "last_node_id": 6, | |
| "last_link_id": 6, | |
| "nodes": [ | |
| { | |
| "id": 1, | |
| "type": "LoadImage", | |
| "pos": [ | |
| -920, | |
| 340 | |
| ], | |
| "size": { | |
| "0": 315, | |
| "1": 346 | |
| }, | |
| "flags": {}, | |
| "widgets_values": [ | |
| "Sora_input_image.png" | |
| ], | |
| "meta": { | |
| "title": "Reference Image (Image-to-Video Input)" | |
| } | |
| }, | |
| { | |
| "id": 2, | |
| "type": "PrimitiveNode", | |
| "pos": [ | |
| -920, | |
| 40 | |
| ], | |
| "size": { | |
| "0": 315, | |
| "1": 42 | |
| }, | |
| "flags": {}, | |
| "widgets_values": [ | |
| "A cinematic shot of a majestic lion walking across a futuristic cityscape at sunset, highly detailed, film grain, 8K." | |
| ], | |
| "meta": { | |
| "title": "Positive Prompt (Text)" | |
| } | |
| }, | |
| { | |
| "id": 3, | |
| "type": "PrimitiveNode", | |
| "pos": [ | |
| -920, | |
| 170 | |
| ], | |
| "size": { | |
| "0": 315, | |
| "1": 42 | |
| }, | |
| "flags": {}, | |
| "widgets_values": [ | |
| "ugly, watermark, low quality, static, blurry, monochrome" | |
| ], | |
| "meta": { | |
| "title": "Negative Prompt (Text)" | |
| } | |
| }, | |
| { | |
| "id": 4, | |
| "type": "Kling Camera Controls", | |
| "pos": [ | |
| -570, | |
| 180 | |
| ], | |
| "size": { | |
| "0": 250, | |
| "1": 138 | |
| }, | |
| "flags": {}, | |
| "widgets_values": [ | |
| "Zoom In", | |
| 200 | |
| ], | |
| "meta": { | |
| "title": "Kling Camera Controls" | |
| } | |
| }, | |
| { | |
| "id": 5, | |
| "type": "Kling Image to Video", | |
| "pos": [ | |
| -280, | |
| -10 | |
| ], | |
| "size": { | |
| "0": 370, | |
| "1": 350 | |
| }, | |
| "flags": {}, | |
| "widgets_values": [ | |
| 0, | |
| "mp4", | |
| 15, | |
| 1280, | |
| 720, | |
| 10, | |
| "dynamic", | |
| "aesthetic", | |
| 1, | |
| 0, | |
| 1 | |
| ], | |
| "meta": { | |
| "title": "Kling Image to Video (Sora 2 Replacement)" | |
| } | |
| }, | |
| { | |
| "id": 6, | |
| "type": "SaveVideo", | |
| "pos": [ | |
| 120, | |
| 140 | |
| ], | |
| "size": { | |
| "0": 200, | |
| "1": 154 | |
| }, | |
| "flags": {}, | |
| "widgets_values": [ | |
| "Kling_Sora_Output_", | |
| "image/video", | |
| 24, | |
| "h264-mp4" | |
| ], | |
| "meta": { | |
| "title": "Save Video" | |
| } | |
| } | |
| ], | |
| "links": [ | |
| { | |
| "id": 1, | |
| "origin_id": 2, | |
| "origin_slot": 0, | |
| "target_id": 5, | |
| "target_slot": 0 | |
| }, | |
| { | |
| "id": 2, | |
| "origin_id": 3, | |
| "origin_slot": 0, | |
| "target_id": 5, | |
| "target_slot": 1 | |
| }, | |
| { | |
| "id": 3, | |
| "origin_id": 1, | |
| "origin_slot": 0, | |
| "target_id": 5, | |
| "target_slot": 2 | |
| }, | |
| { | |
| "id": 4, | |
| "origin_id": 4, | |
| "origin_slot": 0, | |
| "target_id": 5, | |
| "target_slot": 3 | |
| }, | |
| { | |
| "id": 6, | |
| "origin_id": 5, | |
| "origin_slot": 0, | |
| "target_id": 6, | |
| "target_slot": 0 | |
| } | |
| ], | |
| "groups": [ | |
| { | |
| "title": "Sora 2 (Kling API Implementation)", | |
| "color": "#a1d798", | |
| "bounding": [ | |
| -940, | |
| -30, | |
| 400, | |
| 700 | |
| ] | |
| }, | |
| { | |
| "title": "Inputs", | |
| "color": "#336699", | |
| "bounding": [ | |
| -930, | |
| 30, | |
| -550, | |
| 690 | |
| ] | |
| }, | |
| { | |
| "title": "Output", | |
| "color": "#66a3ff", | |
| "bounding": [ | |
| 110, | |
| 130, | |
| 330, | |
| 310 | |
| ] | |
| } | |
| ], | |
| "config": {}, | |
| "extra": { | |
| "workflow_api": 0.4, | |
| "__comment": "Built with anycoder https://huggingface.co/spaces/akhaliq/anycoder" | |
| } | |
| }</pre> | |
| </div> | |
| <script> | |
| function copyToClipboard() { | |
| const jsonContent = document.getElementById('json-content').textContent; | |
| navigator.clipboard.writeText(jsonContent).then(() => { | |
| const btn = document.querySelector('.copy-btn'); | |
| const originalText = btn.textContent; | |
| btn.textContent = 'β Copied!'; | |
| setTimeout(() => { | |
| btn.textContent = originalText; | |
| }, 2000); | |
| }); | |
| } | |
| function downloadJSON() { | |
| const jsonContent = document.getElementById('json-content').textContent; | |
| const blob = new Blob([jsonContent], { type: 'application/json' }); | |
| const url = URL.createObjectURL(blob); | |
| const a = document.createElement('a'); | |
| a.href = url; | |
| a.download = 'comfyui_workflow.json'; | |
| document.body.appendChild(a); | |
| a.click(); | |
| document.body.removeChild(a); | |
| URL.revokeObjectURL(url); | |
| } | |
| // Add syntax highlighting | |
| function highlightJSON() { | |
| const content = document.getElementById('json-content'); | |
| let html = content.innerHTML; | |
| // Highlight different JSON elements | |
| html = html.replace(/"([^"]+)":/g, '<span class="json-key">"$1":</span>'); | |
| html = html.replace(/: "([^"]*)"/g, ': <span class="json-string">"$1"</span>'); | |
| html = html.replace(/: (-?\d+\.?\d*)/g, ': <span class="json-number">$1</span>'); | |
| html = html.replace(/: (true|false)/g, ': <span class="json-boolean">$1</span>'); | |
| html = html.replace(/: null/g, ': <span class="json-null">null</span>'); | |
| content.innerHTML = html; | |
| } | |
| // Apply syntax highlighting after page load | |
| window.addEventListener('load', highlightJSON); | |
| </script> | |
| </body> | |
| </html> |