bleckhert commited on
Commit
4626b7a
·
verified ·
1 Parent(s): d6abe16

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +844 -19
index.html CHANGED
@@ -1,19 +1,844 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ComfyUI Workflow</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+ body {
14
+ font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
15
+ background-color: #000000;
16
+ color: #f5f5f7;
17
+ line-height: 1.6;
18
+ padding: 20px;
19
+ min-height: 100vh;
20
+ }
21
+ .container {
22
+ max-width: 1200px;
23
+ margin: 0 auto;
24
+ }
25
+ .header {
26
+ text-align: center;
27
+ margin-bottom: 40px;
28
+ padding: 40px 20px;
29
+ }
30
+ .header h1 {
31
+ font-size: 48px;
32
+ font-weight: 600;
33
+ color: #ffffff;
34
+ margin-bottom: 12px;
35
+ letter-spacing: -0.02em;
36
+ }
37
+ .header p {
38
+ font-size: 18px;
39
+ color: #86868b;
40
+ font-weight: 400;
41
+ }
42
+ .controls {
43
+ display: flex;
44
+ gap: 12px;
45
+ margin-bottom: 24px;
46
+ justify-content: center;
47
+ }
48
+ .btn {
49
+ padding: 12px 24px;
50
+ border: none;
51
+ border-radius: 24px;
52
+ font-size: 14px;
53
+ font-weight: 500;
54
+ cursor: pointer;
55
+ transition: all 0.2s;
56
+ font-family: inherit;
57
+ }
58
+ .btn-primary {
59
+ background: #ffffff;
60
+ color: #000000;
61
+ }
62
+ .btn-primary:hover {
63
+ background: #f5f5f7;
64
+ transform: scale(0.98);
65
+ }
66
+ .btn-secondary {
67
+ background: #1d1d1f;
68
+ color: #f5f5f7;
69
+ border: 1px solid #424245;
70
+ }
71
+ .btn-secondary:hover {
72
+ background: #2d2d2f;
73
+ transform: scale(0.98);
74
+ }
75
+ .json-container {
76
+ background-color: #1d1d1f;
77
+ border-radius: 16px;
78
+ padding: 32px;
79
+ overflow-x: auto;
80
+ border: 1px solid #424245;
81
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
82
+ }
83
+ pre {
84
+ margin: 0;
85
+ font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
86
+ font-size: 13px;
87
+ line-height: 1.6;
88
+ white-space: pre-wrap;
89
+ word-wrap: break-word;
90
+ }
91
+ .json-key {
92
+ color: #9cdcfe;
93
+ }
94
+ .json-string {
95
+ color: #ce9178;
96
+ }
97
+ .json-number {
98
+ color: #b5cea8;
99
+ }
100
+ .json-boolean {
101
+ color: #569cd6;
102
+ }
103
+ .json-null {
104
+ color: #569cd6;
105
+ }
106
+ .success {
107
+ color: #30d158;
108
+ }
109
+ @media (max-width: 768px) {
110
+ .header h1 {
111
+ font-size: 32px;
112
+ }
113
+ .controls {
114
+ flex-direction: column;
115
+ }
116
+ .json-container {
117
+ padding: 20px;
118
+ }
119
+ }
120
+ </style>
121
+ </head>
122
+ <body>
123
+ <div class="container">
124
+ <div class="header">
125
+ <h1>ComfyUI Workflow</h1>
126
+ <p>View and download your workflow JSON</p>
127
+ </div>
128
+
129
+ <div class="controls">
130
+ <button class="btn btn-primary" onclick="downloadJSON()">Download JSON</button>
131
+ <button class="btn btn-secondary" onclick="copyToClipboard()">Copy to Clipboard</button>
132
+ </div>
133
+
134
+ <div class="json-container">
135
+ <pre id="json-content">{
136
+ "last_node_id": 15,
137
+ "last_link_id": 13,
138
+ "nodes": [
139
+ {
140
+ "id": 1,
141
+ "type": "LoadImage",
142
+ "pos": [
143
+ 100,
144
+ 100
145
+ ],
146
+ "size": [
147
+ 320,
148
+ 280
149
+ ],
150
+ "flags": {},
151
+ "order": 0,
152
+ "mode": 0,
153
+ "inputs": [],
154
+ "outputs": [
155
+ [
156
+ "IMAGE",
157
+ 0
158
+ ]
159
+ ],
160
+ "properties": {},
161
+ "widgets_values": [
162
+ "source_face.png",
163
+ "image"
164
+ ]
165
+ },
166
+ {
167
+ "id": 2,
168
+ "type": "LoadImage",
169
+ "pos": [
170
+ 100,
171
+ 450
172
+ ],
173
+ "size": [
174
+ 320,
175
+ 280
176
+ ],
177
+ "flags": {},
178
+ "order": 1,
179
+ "mode": 0,
180
+ "inputs": [],
181
+ "outputs": [
182
+ [
183
+ "IMAGE",
184
+ 0
185
+ ]
186
+ ],
187
+ "properties": {},
188
+ "widgets_values": [
189
+ "target_image.png",
190
+ "image"
191
+ ]
192
+ },
193
+ {
194
+ "id": 3,
195
+ "type": "LoadImageMask",
196
+ "pos": [
197
+ 480,
198
+ 100
199
+ ],
200
+ "size": [
201
+ 320,
202
+ 280
203
+ ],
204
+ "flags": {},
205
+ "order": 2,
206
+ "mode": 0,
207
+ "inputs": [],
208
+ "outputs": [
209
+ [
210
+ "MASK",
211
+ 0
212
+ ]
213
+ ],
214
+ "properties": {},
215
+ "widgets_values": [
216
+ "source_face.png",
217
+ "image",
218
+ 0
219
+ ]
220
+ },
221
+ {
222
+ "id": 4,
223
+ "type": "LoadImageMask",
224
+ "pos": [
225
+ 480,
226
+ 450
227
+ ],
228
+ "size": [
229
+ 320,
230
+ 280
231
+ ],
232
+ "flags": {},
233
+ "order": 3,
234
+ "mode": 0,
235
+ "inputs": [],
236
+ "outputs": [
237
+ [
238
+ "MASK",
239
+ 0
240
+ ]
241
+ ],
242
+ "properties": {},
243
+ "widgets_values": [
244
+ "target_image.png",
245
+ "image",
246
+ 0
247
+ ]
248
+ },
249
+ {
250
+ "id": 5,
251
+ "type": "ReActorFaceSwap",
252
+ "pos": [
253
+ 860,
254
+ 275
255
+ ],
256
+ "size": [
257
+ 400,
258
+ 300
259
+ ],
260
+ "flags": {},
261
+ "order": 4,
262
+ "mode": 0,
263
+ "inputs": [
264
+ [
265
+ "source_image",
266
+ 0
267
+ ],
268
+ [
269
+ "target_image",
270
+ 0
271
+ ],
272
+ [
273
+ "source_face_index",
274
+ 0
275
+ ],
276
+ [
277
+ "target_face_index",
278
+ 0
279
+ ],
280
+ [
281
+ "mask_source",
282
+ 0
283
+ ],
284
+ [
285
+ "mask_target",
286
+ 0
287
+ ]
288
+ ],
289
+ "outputs": [
290
+ [
291
+ "IMAGE",
292
+ 0
293
+ ],
294
+ [
295
+ "FACE_MODEL",
296
+ 0
297
+ ]
298
+ ],
299
+ "properties": {},
300
+ "widgets_values": [
301
+ 0,
302
+ 0,
303
+ "true",
304
+ "false",
305
+ "false",
306
+ 0.5,
307
+ "GFPGAN",
308
+ 0.5,
309
+ "None",
310
+ 1.0,
311
+ "true",
312
+ "false"
313
+ ]
314
+ },
315
+ {
316
+ "id": 6,
317
+ "type": "PreviewImage",
318
+ "pos": [
319
+ 1320,
320
+ 100
321
+ ],
322
+ "size": [
323
+ 320,
324
+ 280
325
+ ],
326
+ "flags": {},
327
+ "order": 5,
328
+ "mode": 0,
329
+ "inputs": [
330
+ [
331
+ "images",
332
+ 0
333
+ ]
334
+ ],
335
+ "outputs": [],
336
+ "properties": {},
337
+ "widgets_values": []
338
+ },
339
+ {
340
+ "id": 7,
341
+ "type": "SaveImage",
342
+ "pos": [
343
+ 1320,
344
+ 450
345
+ ],
346
+ "size": [
347
+ 320,
348
+ 280
349
+ ],
350
+ "flags": {},
351
+ "order": 6,
352
+ "mode": 0,
353
+ "inputs": [
354
+ [
355
+ "images",
356
+ 0
357
+ ]
358
+ ],
359
+ "outputs": [],
360
+ "properties": {},
361
+ "widgets_values": [
362
+ "ComfyUI",
363
+ "FaceSwap_Result"
364
+ ]
365
+ },
366
+ {
367
+ "id": 8,
368
+ "type": "PrimitiveInt",
369
+ "pos": [
370
+ 480,
371
+ 780
372
+ ],
373
+ "size": [
374
+ 200,
375
+ 60
376
+ ],
377
+ "flags": {},
378
+ "order": 7,
379
+ "mode": 0,
380
+ "inputs": [],
381
+ "outputs": [
382
+ [
383
+ "INT",
384
+ 0
385
+ ]
386
+ ],
387
+ "properties": {},
388
+ "widgets_values": [
389
+ 0
390
+ ]
391
+ },
392
+ {
393
+ "id": 9,
394
+ "type": "PrimitiveInt",
395
+ "pos": [
396
+ 480,
397
+ 880
398
+ ],
399
+ "size": [
400
+ 200,
401
+ 60
402
+ ],
403
+ "flags": {},
404
+ "order": 8,
405
+ "mode": 0,
406
+ "inputs": [],
407
+ "outputs": [
408
+ [
409
+ "INT",
410
+ 0
411
+ ]
412
+ ],
413
+ "properties": {},
414
+ "widgets_values": [
415
+ 0
416
+ ]
417
+ },
418
+ {
419
+ "id": 10,
420
+ "type": "PrimitiveFloat",
421
+ "pos": [
422
+ 480,
423
+ 980
424
+ ],
425
+ "size": [
426
+ 200,
427
+ 60
428
+ ],
429
+ "flags": {},
430
+ "order": 9,
431
+ "mode": 0,
432
+ "inputs": [],
433
+ "outputs": [
434
+ [
435
+ "FLOAT",
436
+ 0
437
+ ]
438
+ ],
439
+ "properties": {},
440
+ "widgets_values": [
441
+ 0.5
442
+ ]
443
+ },
444
+ {
445
+ "id": 11,
446
+ "type": "PrimitiveFloat",
447
+ "pos": [
448
+ 480,
449
+ 1080
450
+ ],
451
+ "size": [
452
+ 200,
453
+ 60
454
+ ],
455
+ "flags": {},
456
+ "order": 10,
457
+ "mode": 0,
458
+ "inputs": [],
459
+ "outputs": [
460
+ [
461
+ "FLOAT",
462
+ 0
463
+ ]
464
+ ],
465
+ "properties": {},
466
+ "widgets_values": [
467
+ 1.0
468
+ ]
469
+ },
470
+ {
471
+ "id": 12,
472
+ "type": "PrimitiveBoolean",
473
+ "pos": [
474
+ 100,
475
+ 780
476
+ ],
477
+ "size": [
478
+ 200,
479
+ 60
480
+ ],
481
+ "flags": {},
482
+ "order": 11,
483
+ "mode": 0,
484
+ "inputs": [],
485
+ "outputs": [
486
+ [
487
+ "BOOLEAN",
488
+ 0
489
+ ]
490
+ ],
491
+ "properties": {},
492
+ "widgets_values": [
493
+ true
494
+ ]
495
+ },
496
+ {
497
+ "id": 13,
498
+ "type": "PrimitiveBoolean",
499
+ "pos": [
500
+ 100,
501
+ 880
502
+ ],
503
+ "size": [
504
+ 200,
505
+ 60
506
+ ],
507
+ "flags": {},
508
+ "order": 12,
509
+ "mode": 0,
510
+ "inputs": [],
511
+ "outputs": [
512
+ [
513
+ "BOOLEAN",
514
+ 0
515
+ ]
516
+ ],
517
+ "properties": {},
518
+ "widgets_values": [
519
+ false
520
+ ]
521
+ },
522
+ {
523
+ "id": 14,
524
+ "type": "PrimitiveBoolean",
525
+ "pos": [
526
+ 100,
527
+ 980
528
+ ],
529
+ "size": [
530
+ 200,
531
+ 60
532
+ ],
533
+ "flags": {},
534
+ "order": 13,
535
+ "mode": 0,
536
+ "inputs": [],
537
+ "outputs": [
538
+ [
539
+ "BOOLEAN",
540
+ 0
541
+ ]
542
+ ],
543
+ "properties": {},
544
+ "widgets_values": [
545
+ true
546
+ ]
547
+ },
548
+ {
549
+ "id": 15,
550
+ "type": "Note",
551
+ "pos": [
552
+ 100,
553
+ 1100
554
+ ],
555
+ "size": [
556
+ 400,
557
+ 200
558
+ ],
559
+ "flags": {},
560
+ "order": 14,
561
+ "mode": 0,
562
+ "inputs": [],
563
+ "outputs": [],
564
+ "properties": {},
565
+ "widgets_values": [
566
+ "Face Swap Application\n\n1. Load source face image (face to extract)\n2. Load target image (image to swap face into)\n3. Optional: Load masks for precise control\n4. Adjust settings:\n - Face indices: Select which face if multiple\n - Face restoration: Enable GFPGAN/CodeFormer\n - Strength: Adjust blend intensity\n - Upscaler: Optional face upscaling\n\nBuilt with anycoder - https://huggingface.co/spaces/akhaliq/anycoder"
567
+ ]
568
+ }
569
+ ],
570
+ "links": [
571
+ [
572
+ 1,
573
+ 1,
574
+ 5,
575
+ 0,
576
+ "IMAGE"
577
+ ],
578
+ [
579
+ 2,
580
+ 2,
581
+ 5,
582
+ 1,
583
+ "IMAGE"
584
+ ],
585
+ [
586
+ 3,
587
+ 3,
588
+ 5,
589
+ 5,
590
+ "MASK"
591
+ ],
592
+ [
593
+ 4,
594
+ 4,
595
+ 5,
596
+ 6,
597
+ "MASK"
598
+ ],
599
+ [
600
+ 5,
601
+ 5,
602
+ 6,
603
+ 0,
604
+ "IMAGE"
605
+ ],
606
+ [
607
+ 5,
608
+ 5,
609
+ 7,
610
+ 0,
611
+ "IMAGE"
612
+ ],
613
+ [
614
+ 8,
615
+ 0,
616
+ 5,
617
+ 2,
618
+ "INT"
619
+ ],
620
+ [
621
+ 9,
622
+ 0,
623
+ 5,
624
+ 3,
625
+ "INT"
626
+ ],
627
+ [
628
+ 10,
629
+ 0,
630
+ 5,
631
+ 6,
632
+ "FLOAT"
633
+ ],
634
+ [
635
+ 11,
636
+ 0,
637
+ 5,
638
+ 9,
639
+ "FLOAT"
640
+ ],
641
+ [
642
+ 12,
643
+ 0,
644
+ 5,
645
+ 4,
646
+ "BOOLEAN"
647
+ ],
648
+ [
649
+ 13,
650
+ 0,
651
+ 5,
652
+ 5,
653
+ "BOOLEAN"
654
+ ],
655
+ [
656
+ 14,
657
+ 0,
658
+ 5,
659
+ 10,
660
+ "BOOLEAN"
661
+ ]
662
+ ],
663
+ "groups": [
664
+ {
665
+ "title": "Source Face",
666
+ "bounding": [
667
+ 80,
668
+ 80,
669
+ 740,
670
+ 320
671
+ ],
672
+ "color": "#3f789e",
673
+ "font_size": 24
674
+ },
675
+ {
676
+ "title": "Target Image",
677
+ "bounding": [
678
+ 80,
679
+ 430,
680
+ 740,
681
+ 320
682
+ ],
683
+ "color": "#8f3e8e",
684
+ "font_size": 24
685
+ },
686
+ {
687
+ "title": "Face Swap Settings",
688
+ "bounding": [
689
+ 80,
690
+ 760,
691
+ 620,
692
+ 400
693
+ ],
694
+ "color": "#5e8f3e",
695
+ "font_size": 24
696
+ },
697
+ {
698
+ "title": "Output",
699
+ "bounding": [
700
+ 1300,
701
+ 80,
702
+ 360,
703
+ 670
704
+ ],
705
+ "color": "#bf5f3f",
706
+ "font_size": 24
707
+ }
708
+ ],
709
+ "config": {},
710
+ "extra": {
711
+ "workspace_info": {
712
+ "app_mode": true,
713
+ "app_inputs": [
714
+ {
715
+ "node_id": 1,
716
+ "name": "Source Face",
717
+ "type": "image",
718
+ "description": "Upload the face image to extract"
719
+ },
720
+ {
721
+ "node_id": 2,
722
+ "name": "Target Image",
723
+ "type": "image",
724
+ "description": "Upload the image to swap face into"
725
+ },
726
+ {
727
+ "node_id": 8,
728
+ "name": "Source Face Index",
729
+ "type": "int",
730
+ "description": "Which face to use from source (0 = first face)"
731
+ },
732
+ {
733
+ "node_id": 9,
734
+ "name": "Target Face Index",
735
+ "type": "int",
736
+ "description": "Which face to replace in target (0 = first face)"
737
+ },
738
+ {
739
+ "node_id": 10,
740
+ "name": "Face Restoration Strength",
741
+ "type": "float",
742
+ "description": "GFPGAN/CodeFormer restoration strength (0-1)"
743
+ },
744
+ {
745
+ "node_id": 11,
746
+ "name": "Upscale Factor",
747
+ "type": "float",
748
+ "description": "Face upscaling multiplier"
749
+ },
750
+ {
751
+ "node_id": 12,
752
+ "name": "Enable Face Restoration",
753
+ "type": "boolean",
754
+ "description": "Apply face restoration after swap"
755
+ },
756
+ {
757
+ "node_id": 13,
758
+ "name": "Enable Mask",
759
+ "type": "boolean",
760
+ "description": "Use masks for precise face placement"
761
+ },
762
+ {
763
+ "node_id": 14,
764
+ "name": "Save Output",
765
+ "type": "boolean",
766
+ "description": "Save the result to disk"
767
+ }
768
+ ],
769
+ "app_outputs": [
770
+ {
771
+ "node_id": 6,
772
+ "name": "Preview",
773
+ "description": "Preview the face swap result"
774
+ }
775
+ ],
776
+ "app_title": "Face Swap Studio",
777
+ "app_description": "Swap faces between two images with advanced controls for face selection, restoration, and upscaling. Upload a source face and target image to create realistic face swaps.",
778
+ "app_theme": "modern",
779
+ "app_layout": "horizontal"
780
+ }
781
+ }
782
+ }</pre>
783
+ </div>
784
+ </div>
785
+
786
+ <script>
787
+ function copyToClipboard() {
788
+ const jsonContent = document.getElementById('json-content').textContent;
789
+ navigator.clipboard.writeText(jsonContent).then(() => {
790
+ const btn = event.target;
791
+ const originalText = btn.textContent;
792
+ btn.textContent = 'Copied!';
793
+ btn.classList.add('success');
794
+ setTimeout(() => {
795
+ btn.textContent = originalText;
796
+ btn.classList.remove('success');
797
+ }, 2000);
798
+ }).catch(err => {
799
+ alert('Failed to copy to clipboard');
800
+ });
801
+ }
802
+
803
+ function downloadJSON() {
804
+ const jsonContent = document.getElementById('json-content').textContent;
805
+ const blob = new Blob([jsonContent], { type: 'application/json' });
806
+ const url = URL.createObjectURL(blob);
807
+ const a = document.createElement('a');
808
+ a.href = url;
809
+ a.download = 'comfyui_workflow.json';
810
+ document.body.appendChild(a);
811
+ a.click();
812
+ document.body.removeChild(a);
813
+ URL.revokeObjectURL(url);
814
+
815
+ const btn = event.target;
816
+ const originalText = btn.textContent;
817
+ btn.textContent = 'Downloaded!';
818
+ btn.classList.add('success');
819
+ setTimeout(() => {
820
+ btn.textContent = originalText;
821
+ btn.classList.remove('success');
822
+ }, 2000);
823
+ }
824
+
825
+ // Add syntax highlighting
826
+ function highlightJSON() {
827
+ const content = document.getElementById('json-content');
828
+ let html = content.innerHTML;
829
+
830
+ // Highlight different JSON elements
831
+ html = html.replace(/"([^"]+)":/g, '<span class="json-key">"$1":</span>');
832
+ html = html.replace(/: "([^"]*)"/g, ': <span class="json-string">"$1"</span>');
833
+ html = html.replace(/: (-?\d+\.?\d*)/g, ': <span class="json-number">$1</span>');
834
+ html = html.replace(/: (true|false)/g, ': <span class="json-boolean">$1</span>');
835
+ html = html.replace(/: null/g, ': <span class="json-null">null</span>');
836
+
837
+ content.innerHTML = html;
838
+ }
839
+
840
+ // Apply syntax highlighting after page load
841
+ window.addEventListener('load', highlightJSON);
842
+ </script>
843
+ </body>
844
+ </html>