Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cnncodex/ai-image-generator

This project provides a simple and efficient way to generate images using text prompts. Utilizing Cloudflare Workers and the DreamShaper AI model, this service can transform your textual descriptions into stunning visual representations.
https://github.com/cnncodex/ai-image-generator

ai ai-image-generation api-integration cloudflare-workers javascript

Last synced: 17 days ago
JSON representation

This project provides a simple and efficient way to generate images using text prompts. Utilizing Cloudflare Workers and the DreamShaper AI model, this service can transform your textual descriptions into stunning visual representations.

Awesome Lists containing this project

README

        

# 🌄 AI Image Generator

This repository contains a simple Cloudflare Worker script that generates images based on a text prompt using the DreamShaper model from the Cloudflare AI service.

## ✨ Features

- 🎨 Generates images based on text prompts
- 🖼️ Returns the generated image in PNG format
- ⚠️ Handles errors gracefully

## 🚀 Installation

1. Clone the repository:
```bash
git clone https://github.com/cnncodex/ai-image-generator.git
cd ai-image-generator
```

2. Install Cloudflare Workers CLI (Wrangler):
```bash
npm install -g wrangler
```

## 🔧 Configuration

1. Create a Cloudflare account and set up a new Worker.
2. Set up your environment variables in the Cloudflare dashboard.

## 🛠️ Usage

### 🚀 Deploying the Worker

1. Authenticate Wrangler with your Cloudflare account:
```bash
wrangler login
```

2. Publish your Worker:
```bash
wrangler publish
```

### 🌐 Making a Request

To generate an image, send a GET request to your deployed Worker's URL with the `prompt` query parameter.

Example:
```bash
curl "https://your-worker-url.workers.dev/?prompt=A beautiful sunset over the mountains"