/frontendiffusion

Frontend Diffusion is an end-to-end LLM-powered tool that generates high-quality websites from user sketches.

Primary LanguageJavaScript

Frontend Diffusion: Exploring Intent-Based User Interfaces through Sketching to Coding Task Transition

PRs Welcome GitHub Stars GitHub Forks

Paper PaperPlatform WebsiteVideo Demo VideoTwitter Twitter/X

alt text

Frontend Diffusion is an end-to-end LLM-powered tool that generates high-quality websites from user sketches. Users can input a rough sketch on the canvas, which the system then transforms into a high-quality website page. You could use it to generate websites from sketch.

The generated websites, as illustrated below, exhibit generally satisfactory visual appearances. These include contextually appropriate textual content, imagery, color schemes, layouts, and functionalities.

Screenshots of generated websites spanning commercial and academic domains:

alt text

This tool is used by other open source projects such as GPU Bartender.

How to Use

  1. Draw your sketch in the canvas panel using the toolbar on the left.
  2. Provide a brief website description in the input area at the top right corner.
  3. Click "Generate" to process your input.
  4. View the generated UI in the preview pane on the right.
  5. Access and copy the HTML code by toggling to the "Code Panel" and using the "Copy" button.

Requirements

Open the terminal on your computer or use the terminal provided by your integrated development environment (e.g., Visual Studio Code). Ensure that the terminal is opened in the project folder directory.

API Key Requirements

Local Deployment Instructions

  1. Navigate to the .env file in your project directory.
  2. Insert your API key information using the following format (you could get ANTHROPIC API Key from : anthropic.com):

ANTHROPIC_API_KEY=YOUR_ANTHROPIC_API_KEY

  1. Save the .env file after adding your API keys.

Note: Keep your API keys confidential and never share them publicly.

Module Requirements

Installation

Before running the program, follow these steps:

  1. Install dependencies:

npm install

  1. If you encounter errors like "Cannot find module '@module_name'", install the specific module:

For example :

npm install @anthropic-ai/sdk
npm install dotenv

(Add any other specific modules as needed)

Running the Application

Navigate to the /backend directory (cd backend), then use the command:

node server.js

Navigate to the /frontend directory (cd frontend), then use the command:

npx live-server

You should now see the application in your browser.

Customization

To edit the page, modify the frontend/index.html file.

Citation

If you use this project in your research, please cite our paper:

@article{zhang2024frontend,
  title={Frontend Diffusion: Exploring Intent-Based User Interfaces through Abstract-to-Detailed Task Transitions},
  author={Zhang, Qinshi and Hendra, Latisha Besariani and Chi, Mohan and Ding, Zijian},
  journal={arXiv preprint arXiv:2408.00778},
  year={2024}
}

Related Paper

Ding, Zijian. "Towards Intent-based User Interfaces: Charting the Design Space of Intent-AI Interactions Across Task Types", arXiv preprint arXiv:2404.18196 (2024).