Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/cnncodex/ai-image-generator
- Owner: cnncodex
- License: mit
- Created: 2024-07-30T15:29:17.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-30T15:34:11.000Z (5 months ago)
- Last Synced: 2024-07-30T19:36:58.431Z (5 months ago)
- Topics: ai, ai-image-generation, api-integration, cloudflare-workers, javascript
- Language: JavaScript
- Homepage: https://aiimagegenerator.cncodex.workers.dev/
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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"