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": 1, | |
| "last_link_id": 1, | |
| "nodes": [ | |
| { | |
| "id": 1, | |
| "type": "OpenAI Chat API Node ComfyUI Official Example", | |
| "pos": [ | |
| 100, | |
| 100 | |
| ], | |
| "size": [ | |
| 300, | |
| 200 | |
| ], | |
| "flags": {}, | |
| "order": 0, | |
| "mode": 0, | |
| "inputs": [], | |
| "outputs": [], | |
| "properties": { | |
| "comment": "Built with anycoder - https://huggingface.co/spaces/akhaliq/anycoder" | |
| }, | |
| "widgets_values": [ | |
| "sk-your-api-key-here", | |
| "gpt-4-vision-preview", | |
| "You are a helpful assistant collaborating on a ComfyUI development project. Design a custom chat interface for dedicated AI communication outside of this development environment.", | |
| "What tools do you have available for this chat interface design?", | |
| 0.7, | |
| 150, | |
| false | |
| ] | |
| } | |
| ], | |
| "links": [], | |
| "groups": [], | |
| "config": {}, | |
| "extra": { | |
| "ds": { | |
| "scale": 1, | |
| "offset": [ | |
| 0, | |
| 0 | |
| ] | |
| } | |
| } | |
| }</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> |