Welcome to your all-in-one static UI design tool powered by Comfy AI! Tune your styles, get code, and let the AI give you new ideas.
This input simulates where you would enter an API key for actual AI service calls. Comfy AI will log its use when you click "Improve UI." No actual key is needed for this demo.
Generate styled HTML snippets for common UI elements. Copy the code and "drag and drop" (paste) them into your project's HTML!
Use these tools to generate the necessary files or code snippets for your project. Copy the content from the textareas below and save them as the suggested file names.
Generates `my-style-sdk.css`, `comfyai.js`, `my-sdk-utils.js` content, and an example `index.html`. Save these into a new project folder.
Generates a Base64 code reflecting your current UI tuner settings. You can use this to easily re-apply these styles.
Paste a previously generated one-time code here to apply those styles to the live preview.
Generates a JavaScript snippet you can paste into your project's main JS file to easily integrate Comfy.js.
Welcome to the Comfy AI ecosystem! In this purely static (HTML, CSS, JavaScript) setup, there's no traditional command-line application. Instead, your **index.html "Comfy AI UI Workbench" acts as your Comfy CLI**, providing interactive tools, and the **comfyai.js library serves as your Comfy SDK** for programmatic style control.
index.html Workbench)You interact with Comfy AI features by clicking buttons and using input fields directly within this webpage. Think of each button as a "command" you're executing.
📦 Initialize Comfy Project (Simulated Command): Click this button to generate the foundational files for a new Comfy-styled project:
my-style-sdk.css: Your main stylesheet with custom CSS properties.comfyai.js: The core Comfy AI SDK (the source code of this very file!).my-sdk-utils.js: A separate utility file (its contents are also part of comfyai.js, but provided for modularity).index.html: A ready-to-use template for your app.To "execute" this, simply copy the content from the textareas and save them to their respective files in a new project folder on your computer.
🎨 Style Tuner (Interactive Tool): This section lets you visually "tune" your UI's primary color, border radius, and shadow intensity in real-time on the live preview.✨ Improve UI (Comfy AI) (Simulated AI Command): Clicking this button will trigger the built-in AI-like logic in comfyai.js to suggest and apply a tasteful, slightly randomized new style combination to your UI.✨ Get One-Time Style Code (Export Command): Generates a compact Base64 encoded string representing your current style tuner settings. This is perfect for saving or sharing a specific design.➡️ Apply Code (Import Command): Paste a previously generated one-time code into the input field and click this button to instantly apply those saved styles to the live preview.📚 Comfy Components Library (Component Generation Tool): This section lets you "grab" pre-styled HTML snippets for common UI elements (buttons, input fields, text areas, select dropdowns). Just click the "Generate HTML" button, copy the code, and paste it into your own HTML files. This is your "styles folder" in action!🧩 Get JS Integration Snippet (Integration Helper): Provides a JavaScript code block that shows you exactly how to import and use the Comfy object in your own main JavaScript file (e.g., script.js).
Since we're working entirely statically, there's no command like comfy deploy to run in a terminal. "Deployment" simply means:
index.html file directly in a web browser from your local machine!Comfy Class in comfyai.js)
The Comfy JavaScript class, made globally available as window.Comfy after comfyai.js loads, is your SDK. You use it directly in your own JavaScript code to control styles and interact with Comfy AI features.
Example SDK Usage:
// In your main JavaScript file (e.g., script.js), loaded AFTER comfyai.js
document.addEventListener('DOMContentLoaded', () => {
// Access the global Comfy instance
const comfy = window.Comfy;
// Simulate setting a project ID or API key (useful for logging/future features)
comfy.setApiKey('my-unique-project-id-123'); // Or any string you want to use as an identifier
// Apply styles programmatically
comfy.applyStyles({
primaryColor: '#9333ea', // A new vibrant purple
borderRadius: 12,
shadowIntensity: 65
});
// Trigger the AI improvement directly from your script
const newStyleSuggestion = comfy.improveUI();
console.log("Comfy AI suggested these new styles:", newStyleSuggestion);
// Get HTML for a custom component
const customButtonHtml = Comfy.getStyledButtonHtml("Click Me for Fun!");
document.getElementById('myCustomDiv').innerHTML += customButtonHtml;
});
You can copy the "JS Integration Snippet" from the "Generate Project Files / Code" section above for a ready-to-use boilerplate.
**To "delete comfy":** Since everything is static, simply delete the my-style-sdk.css, my-sdk-utils.js (if you chose to keep it separate), and comfyai.js files from your project folder. Then remove the related links and scripts from your HTML.