my-studio-807 / index.html
AiCoderv2's picture
Upload index.html with huggingface_hub
42ac864 verified
<!DOCTYPE html>
<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">{
"3": {
"class_type": "KSampler",
"inputs": {
"cfg": 8,
"denoise": 1,
"latent_image": [
"5",
0
],
"model": [
"4",
0
],
"negative": [
"7",
0
],
"positive": [
"6",
0
],
"sampler_name": "euler",
"scheduler": "normal",
"seed": 8566257,
"steps": 20
}
},
"4": {
"class_type": "CheckpointLoaderSimple",
"inputs": {
"ckpt_name": "lightx2v/Qwen-Image-Lightning"
}
},
"5": {
"class_type": "EmptyLatentImage",
"inputs": {
"batch_size": 1,
"height": 512,
"width": 512
}
},
"6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"4",
1
],
"text": "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
}
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"4",
1
],
"text": "text, watermark"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"3",
0
],
"vae": [
"4",
2
]
}
},
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
}
},
"metadata": {
"built_with": "anycoder",
"reference": "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>