## Project Template

Based on On-App AI's on-device text-to-image capability, Tuya provides an efficient, low-cost, real-time responsive AI pixel image generation solution for pixel screen products. This solution deploys a lightweight pixel image generation model locally on mobile devices, achieving 1-2 second pixel image generation with support for Bluetooth transmission to devices for display, eliminating the need for cloud inference and greatly improving user experience and business scalability.

### Core Features

<Image
  src='/images/solution/aiTextToImage/template3_en.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
    maxWidth: '300px',
    marginTop: '20px',
    marginRight: '10px',
  }}
/>

<Image
  src='/images/solution/aiTextToImage/template1_en.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
    maxWidth: '300px',
    marginTop: '20px',
    marginRight: '10px',
  }}
/>

<Image
  src='/images/solution/aiTextToImage/template2_en.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
    maxWidth: '300px',
    marginTop: '20px',
  }}
/>

- On-Device AI Text-to-Image: Generate pixel images based on labels with one click, 1-2 second generation, no network required.

- Dynamic Model Updates: Local models load on-demand, with dynamically expandable labels and datasets.

- Pixel Drawing Creation: Supports drawing mode, eraser, paint bucket, and real-time pixel art transmission.

- Image Upload and Cropping: Album/Camera → Pixelization → Generate single-frame GIF → Send to device.

- Bluetooth Large Data Transfer: Supports image and GIF fragmented transparent transmission to pixel screen MCU, enabling real-time preview and display.

- Bluetooth Pixel Screen Debugging: Introduces the overall Bluetooth pixel screen debugging process to help developers quickly start development and debugging.

### Template
  
- [AI Pixel Screen Text-to-Image Tutorial](https://developer.tuya.com/en/miniapp-codelabs/codelabs/on-app-ai-text-to-image/index.html#0)

- [AI Pixel Screen Text-to-Image Template Source Code](https://github.com/Tuya-Community/tuya-ray-materials?path=template/AIPixelScreenTemplate)

When creating a new panel project in the IDE, select the **AI Pixel Screen Text-to-Image Template** to quickly create the project, as shown in the image below:

<Image
  src='/images/solution/aiTextToImage/template-select_en.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
    maxWidth: '800px',
    marginTop: '20px',
  }}
/>

### Materials

- [Bluetooth Data Transfer Tool](https://developer.tuya.com/material/library_oHEKLjj0/component?code=BLETransparentUtils)

- [Pixel Graffiti Component](https://developer.tuya.com/material/library_oHEKLjj0/component?code=Graffiti)

- [Image Selection Component](https://developer.tuya.com/material/library_oHEKLjj0/component?code=ImageAreaPicker)