Back to Reflex

ai_image_gen

packages/reflex-site-shared/src/reflex_site_shared/gallery/templates/image-gen.md

0.9.2a2831 B
Original Source

The following is an app that allows you to generate AI images. The current map uses replicate's api to generate images but can be easily modified to use other image generation services.

Setup

To run this app locally, install Reflex and run:

bash
reflex init --template ai_image_gen

To run the app, set the REPLICATE_API_TOKEN:

bash
export REPLICATE_API_TOKEN=your_api_token_here

Then run:

bash
pip install -r requirements.txt
reflex run

Note: You can get your replicate api token here.

Customizing the Inference

You can customize the app by modifying the generation.py file replacing replicate's api with that of other image generation services.