Spaces:
Configuration error
Configuration error
| <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": 15, | |
| "last_link_id": 20, | |
| "nodes": [ | |
| { | |
| "id": 1, | |
| "type": "CheckpointLoaderSimple", | |
| "pos": [ | |
| 50, | |
| 50 | |
| ], | |
| "size": { | |
| "0": 350, | |
| "1": 100 | |
| }, | |
| "flags": {}, | |
| "order": 0, | |
| "mode": 0, | |
| "outputs": [ | |
| { | |
| "name": "MODEL", | |
| "type": "MODEL", | |
| "links": [ | |
| 2 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| }, | |
| { | |
| "name": "CLIP", | |
| "type": "CLIP", | |
| "links": [ | |
| 3 | |
| ], | |
| "shape": 3, | |
| "slot_index": 1 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "CheckpointLoaderSimple" | |
| }, | |
| "widgets_values": [ | |
| "sd_xl_base_1.0.safetensors" | |
| ] | |
| }, | |
| { | |
| "id": 2, | |
| "type": "CLIPTextEncode", | |
| "pos": [ | |
| 450, | |
| 50 | |
| ], | |
| "size": { | |
| "0": 400, | |
| "1": 200 | |
| }, | |
| "flags": {}, | |
| "order": 1, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "clip", | |
| "type": "CLIP", | |
| "link": 3 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "CONDITIONING", | |
| "type": "CONDITIONING", | |
| "links": [ | |
| 4 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "CLIPTextEncode" | |
| }, | |
| "widgets_values": [ | |
| "professional AI chatbot avatar, friendly face, blue and white color scheme, high quality, digital art, 4k" | |
| ] | |
| }, | |
| { | |
| "id": 3, | |
| "type": "CLIPTextEncode", | |
| "pos": [ | |
| 450, | |
| 300 | |
| ], | |
| "size": { | |
| "0": 400, | |
| "1": 200 | |
| }, | |
| "flags": {}, | |
| "order": 2, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "clip", | |
| "type": "CLIP", | |
| "link": 3 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "CONDITIONING", | |
| "type": "CONDITIONING", | |
| "links": [ | |
| 5 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "CLIPTextEncode" | |
| }, | |
| "widgets_values": [ | |
| "blurry, low quality, distorted, ugly, bad anatomy" | |
| ] | |
| }, | |
| { | |
| "id": 4, | |
| "type": "EmptyLatentImage", | |
| "pos": [ | |
| 500, | |
| 550 | |
| ], | |
| "size": { | |
| "0": 300, | |
| "1": 110 | |
| }, | |
| "flags": {}, | |
| "order": 3, | |
| "mode": 0, | |
| "outputs": [ | |
| { | |
| "name": "LATENT", | |
| "type": "LATENT", | |
| "links": [ | |
| 6 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "EmptyLatentImage" | |
| }, | |
| "widgets_values": [ | |
| 512, | |
| 512, | |
| 1 | |
| ] | |
| }, | |
| { | |
| "id": 5, | |
| "type": "KSampler", | |
| "pos": [ | |
| 950, | |
| 250 | |
| ], | |
| "size": { | |
| "0": 300, | |
| "1": 262 | |
| }, | |
| "flags": {}, | |
| "order": 4, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "model", | |
| "type": "MODEL", | |
| "link": 2 | |
| }, | |
| { | |
| "name": "positive", | |
| "type": "CONDITIONING", | |
| "link": 4 | |
| }, | |
| { | |
| "name": "negative", | |
| "type": "CONDITIONING", | |
| "link": 5 | |
| }, | |
| { | |
| "name": "latent_image", | |
| "type": "LATENT", | |
| "link": 6 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "LATENT", | |
| "type": "LATENT", | |
| "links": [ | |
| 7 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "KSampler" | |
| }, | |
| "widgets_values": [ | |
| 42, | |
| "randomize", | |
| 20, | |
| 8, | |
| "euler", | |
| "normal" | |
| ] | |
| }, | |
| { | |
| "id": 6, | |
| "type": "VAEDecode", | |
| "pos": [ | |
| 1350, | |
| 250 | |
| ], | |
| "size": { | |
| "0": 210, | |
| "1": 46 | |
| }, | |
| "flags": {}, | |
| "order": 5, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "samples", | |
| "type": "LATENT", | |
| "link": 7 | |
| }, | |
| { | |
| "name": "vae", | |
| "type": "VAE", | |
| "link": 8 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "IMAGE", | |
| "type": "IMAGE", | |
| "links": [ | |
| 9 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "VAEDecode" | |
| } | |
| }, | |
| { | |
| "id": 7, | |
| "type": "VAELoader", | |
| "pos": [ | |
| 50, | |
| 200 | |
| ], | |
| "size": { | |
| "0": 350, | |
| "1": 60 | |
| }, | |
| "flags": {}, | |
| "order": 6, | |
| "mode": 0, | |
| "outputs": [ | |
| { | |
| "name": "VAE", | |
| "type": "VAE", | |
| "links": [ | |
| 8 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "VAELoader" | |
| }, | |
| "widgets_values": [ | |
| "sdxl_vae.safetensors" | |
| ] | |
| }, | |
| { | |
| "id": 8, | |
| "type": "SaveImage", | |
| "pos": [ | |
| 1650, | |
| 250 | |
| ], | |
| "size": { | |
| "0": 315, | |
| "1": 270 | |
| }, | |
| "flags": {}, | |
| "order": 7, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "images", | |
| "type": "IMAGE", | |
| "link": 9 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "SaveImage" | |
| }, | |
| "widgets_values": [ | |
| "chatbot_avatar" | |
| ] | |
| }, | |
| { | |
| "id": 9, | |
| "type": "CLIPTextEncode", | |
| "pos": [ | |
| 450, | |
| 750 | |
| ], | |
| "size": { | |
| "0": 400, | |
| "1": 200 | |
| }, | |
| "flags": {}, | |
| "order": 8, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "clip", | |
| "type": "CLIP", | |
| "link": 3 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "CONDITIONING", | |
| "type": "CONDITIONING", | |
| "links": [ | |
| 10 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "CLIPTextEncode" | |
| }, | |
| "widgets_values": [ | |
| "modern chat interface design, clean UI, message bubbles, login screen, mobile app design, professional" | |
| ] | |
| }, | |
| { | |
| "id": 10, | |
| "type": "KSampler", | |
| "pos": [ | |
| 950, | |
| 750 | |
| ], | |
| "size": { | |
| "0": 300, | |
| "1": 262 | |
| }, | |
| "flags": {}, | |
| "order": 9, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "model", | |
| "type": "MODEL", | |
| "link": 2 | |
| }, | |
| { | |
| "name": "positive", | |
| "type": "CONDITIONING", | |
| "link": 10 | |
| }, | |
| { | |
| "name": "negative", | |
| "type": "CONDITIONING", | |
| "link": 5 | |
| }, | |
| { | |
| "name": "latent_image", | |
| "type": "LATENT", | |
| "link": 11 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "LATENT", | |
| "type": "LATENT", | |
| "links": [ | |
| 12 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "CLIPTextEncode" | |
| }, | |
| "widgets_values": [ | |
| 123, | |
| "randomize", | |
| 25, | |
| 8, | |
| "euler", | |
| "normal" | |
| ] | |
| }, | |
| { | |
| "id": 11, | |
| "type": "EmptyLatentImage", | |
| "pos": [ | |
| 500, | |
| 700 | |
| ], | |
| "size": { | |
| "0": 300, | |
| "1": 110 | |
| }, | |
| "flags": {}, | |
| "order": 10, | |
| "mode": 0, | |
| "outputs": [ | |
| { | |
| "name": "LATENT", | |
| "type": "LATENT", | |
| "links": [ | |
| 11 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "EmptyLatentImage" | |
| }, | |
| "widgets_values": [ | |
| 1024, | |
| 768, | |
| 1 | |
| ] | |
| }, | |
| { | |
| "id": 12, | |
| "type": "VAEDecode", | |
| "pos": [ | |
| 1350, | |
| 750 | |
| ], | |
| "size": { | |
| "0": 210, | |
| "1": 46 | |
| }, | |
| "flags": {}, | |
| "order": 11, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "samples", | |
| "type": "LATENT", | |
| "link": 12 | |
| }, | |
| { | |
| "name": "vae", | |
| "type": "VAE", | |
| "link": 8 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "IMAGE", | |
| "type": "IMAGE", | |
| "links": [ | |
| 13 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "VAEDecode" | |
| } | |
| }, | |
| { | |
| "id": 13, | |
| "type": "SaveImage", | |
| "pos": [ | |
| 1650, | |
| 750 | |
| ], | |
| "size": { | |
| "0": 315, | |
| "1": 270 | |
| }, | |
| "flags": {}, | |
| "order": 12, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "images", | |
| "type": "IMAGE", | |
| "link": 13 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "SaveImage" | |
| }, | |
| "widgets_values": [ | |
| "chat_interface_design" | |
| ] | |
| }, | |
| { | |
| "id": 14, | |
| "type": "CLIPTextEncode", | |
| "pos": [ | |
| 450, | |
| 1100 | |
| ], | |
| "size": { | |
| "0": 400, | |
| "1": 200 | |
| }, | |
| "flags": {}, | |
| "order": 13, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "clip", | |
| "type": "CLIP", | |
| "link": 3 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "CONDITIONING", | |
| "type": "CONDITIONING", | |
| "links": [ | |
| 14 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "CLIPTextEncode" | |
| }, | |
| "widgets_values": [ | |
| "AI chatbot feature icons, set of modern icons for chat features, notification icons, user profile, settings, messages, vector style" | |
| ] | |
| }, | |
| { | |
| "id": 15, | |
| "type": "KSampler", | |
| "pos": [ | |
| 950, | |
| 1100 | |
| ], | |
| "size": { | |
| "0": 300, | |
| "1": 262 | |
| }, | |
| "flags": {}, | |
| "order": 14, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "model", | |
| "type": "MODEL", | |
| "link": 2 | |
| }, | |
| { | |
| "name": "positive", | |
| "type": "CONDITIONING", | |
| "link": 14 | |
| }, | |
| { | |
| "name": "negative", | |
| "type": "CONDITIONING", | |
| "link": 5 | |
| }, | |
| { | |
| "name": "latent_image", | |
| "type": "LATENT", | |
| "link": 15 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "LATENT", | |
| "type": "LATENT", | |
| "links": [ | |
| 16 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "KSampler" | |
| }, | |
| "widgets_values": [ | |
| 456, | |
| "randomize", | |
| 30, | |
| 8, | |
| "euler", | |
| "normal" | |
| ] | |
| }, | |
| { | |
| "id": 16, | |
| "type": "EmptyLatentImage", | |
| "pos": [ | |
| 500, | |
| 1050 | |
| ], | |
| "size": { | |
| "0": 300, | |
| "1": 110 | |
| }, | |
| "flags": {}, | |
| "order": 15, | |
| "mode": 0, | |
| "outputs": [ | |
| { | |
| "name": "LATENT", | |
| "type": "LATENT", | |
| "links": [ | |
| 15 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "EmptyLatentImage" | |
| }, | |
| "widgets_values": [ | |
| 1024, | |
| 1024, | |
| 1 | |
| ] | |
| }, | |
| { | |
| "id": 17, | |
| "type": "VAEDecode", | |
| "pos": [ | |
| 1350, | |
| 1100 | |
| ], | |
| "size": { | |
| "0": 210, | |
| "1": 46 | |
| }, | |
| "flags": {}, | |
| "order": 16, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "samples", | |
| "type": "LATENT", | |
| "link": 16 | |
| }, | |
| { | |
| "name": "vae", | |
| "type": "VAE", | |
| "link": 8 | |
| } | |
| ], | |
| "outputs": [ | |
| { | |
| "name": "IMAGE", | |
| "type": "IMAGE", | |
| "links": [ | |
| 17 | |
| ], | |
| "shape": 3, | |
| "slot_index": 0 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "VAEDecode" | |
| } | |
| }, | |
| { | |
| "id": 18, | |
| "type": "SaveImage", | |
| "pos": [ | |
| 1650, | |
| 1100 | |
| ], | |
| "size": { | |
| "0": 315, | |
| "1": 270 | |
| }, | |
| "flags": {}, | |
| "order": 17, | |
| "mode": 0, | |
| "inputs": [ | |
| { | |
| "name": "images", | |
| "type": "IMAGE", | |
| "link": 17 | |
| } | |
| ], | |
| "properties": { | |
| "Node name for S&R": "SaveImage" | |
| }, | |
| "widgets_values": [ | |
| "chatbot_feature_icons" | |
| ] | |
| } | |
| ], | |
| "links": [ | |
| [ | |
| 2, | |
| 1, | |
| 0, | |
| 5, | |
| 0, | |
| "MODEL" | |
| ], | |
| [ | |
| 2, | |
| 1, | |
| 0, | |
| 10, | |
| 0, | |
| "MODEL" | |
| ], | |
| [ | |
| 2, | |
| 1, | |
| 0, | |
| 15, | |
| 0, | |
| "MODEL" | |
| ], | |
| [ | |
| 3, | |
| 1, | |
| 1, | |
| 2, | |
| 0, | |
| "CLIP" | |
| ], | |
| [ | |
| 3, | |
| 1, | |
| 1, | |
| 3, | |
| 0, | |
| "CLIP" | |
| ], | |
| [ | |
| 3, | |
| 1, | |
| 1, | |
| 9, | |
| 0, | |
| "CLIP" | |
| ], | |
| [ | |
| 3, | |
| 1, | |
| 1, | |
| 14, | |
| 0, | |
| "CLIP" | |
| ], | |
| [ | |
| 4, | |
| 2, | |
| 0, | |
| 5, | |
| 1, | |
| "CONDITIONING" | |
| ], | |
| [ | |
| 5, | |
| 3, | |
| 0, | |
| 5, | |
| 2, | |
| "CONDITIONING" | |
| ], | |
| [ | |
| 5, | |
| 3, | |
| 0, | |
| 10, | |
| 2, | |
| "CONDITIONING" | |
| ], | |
| [ | |
| 5, | |
| 3, | |
| 0, | |
| 15, | |
| 2, | |
| "CONDITIONING" | |
| ], | |
| [ | |
| 6, | |
| 4, | |
| 0, | |
| 5, | |
| 3, | |
| "LATENT" | |
| ], | |
| [ | |
| 7, | |
| 5, | |
| 0, | |
| 6, | |
| 0, | |
| "LATENT" | |
| ], | |
| [ | |
| 8, | |
| 7, | |
| 0, | |
| 6, | |
| 1, | |
| "VAE" | |
| ], | |
| [ | |
| 8, | |
| 7, | |
| 0, | |
| 12, | |
| 1, | |
| "VAE" | |
| ], | |
| [ | |
| 8, | |
| 7, | |
| 0, | |
| 17, | |
| 1, | |
| "VAE" | |
| ], | |
| [ | |
| 9, | |
| 6, | |
| 0, | |
| 8, | |
| 0, | |
| "IMAGE" | |
| ], | |
| [ | |
| 10, | |
| 9, | |
| 0, | |
| 10, | |
| 1, | |
| "CONDITIONING" | |
| ], | |
| [ | |
| 11, | |
| 11, | |
| 0, | |
| 10, | |
| 3, | |
| "LATENT" | |
| ], | |
| [ | |
| 12, | |
| 10, | |
| 0, | |
| 12, | |
| 0, | |
| "LATENT" | |
| ], | |
| [ | |
| 13, | |
| 12, | |
| 0, | |
| 13, | |
| 0, | |
| "IMAGE" | |
| ], | |
| [ | |
| 14, | |
| 14, | |
| 0, | |
| 15, | |
| 1, | |
| "CONDITIONING" | |
| ], | |
| [ | |
| 15, | |
| 16, | |
| 0, | |
| 15, | |
| 3, | |
| "LATENT" | |
| ], | |
| [ | |
| 16, | |
| 15, | |
| 0, | |
| 17, | |
| 0, | |
| "LATENT" | |
| ], | |
| [ | |
| 17, | |
| 17, | |
| 0, | |
| 18, | |
| 0, | |
| "IMAGE" | |
| ] | |
| ], | |
| "groups": [ | |
| { | |
| "title": "Chatbot Avatar Generation", | |
| "bounding": [ | |
| 30, | |
| 10, | |
| 1950, | |
| 500 | |
| ], | |
| "color": "#8f8", | |
| "font_size": 24 | |
| }, | |
| { | |
| "title": "Chat Interface Design", | |
| "bounding": [ | |
| 30, | |
| 680, | |
| 1950, | |
| 370 | |
| ], | |
| "color": "#f88", | |
| "font_size": 24 | |
| }, | |
| { | |
| "title": "Feature Icons & UI Elements", | |
| "bounding": [ | |
| 30, | |
| 1030, | |
| 1950, | |
| 370 | |
| ], | |
| "color": "#88f", | |
| "font_size": 24 | |
| } | |
| ], | |
| "config": {}, | |
| "extra": { | |
| "ds": { | |
| "scale": 0.5, | |
| "offset": [ | |
| 0, | |
| 0 | |
| ] | |
| }, | |
| "workspace": { | |
| "position": [ | |
| 0, | |
| 0 | |
| ], | |
| "scale": 1 | |
| } | |
| }, | |
| "version": 0.4, | |
| "metadata": { | |
| "description": "AI Chatbot Visual Assets Generator - Creates complete visual assets for chatbot applications including avatars, interface designs, and feature icons. 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> |