✨ Comfy AI UI Workbench

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.

⚙️ Settings

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.

Live UI Preview (Your App Here)

🎨 Style Tuner

20px
8%

📚 Comfy Components Library
(Your "Styles Folder" for Copy-Pasting)

Generate styled HTML snippets for common UI elements. Copy the code and "drag and drop" (paste) them into your project's HTML!

Buttons

Input Field

Text Area

Select Dropdown

📄 Generate Project Files / Code

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.

📚 Comfy CLI & SDK Documentation

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.

The "Comfy CLI" (Your 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.

"Deployment" in a Static Context

Since we're working entirely statically, there's no command like comfy deploy to run in a terminal. "Deployment" simply means:

  1. Use the "Initialize Comfy Project" and "Generate Component HTML" tools in this workbench to get all the HTML, CSS, and JS files you need.
  2. Save these generated files to a folder on your computer.
  3. Upload that entire folder to any static web hosting service (like GitHub Pages, Netlify, or Vercel), or simply open your main index.html file directly in a web browser from your local machine!

The "Comfy SDK" (Your 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.