README.md

Text-to-Image Generator with Memory

Ever wished you could remember the prompt that generated that cool image you made? This project gives you a way to save the generated images you love back to your repository, alongside the prompt that generated it and other metadata.

Navigate to the Capsules tab to try it for yourself, and save some data back to the repository!

Browse what's been created

Click through previous prompts and images using the left-hand file browser through the UI. Or for more native browsing, use the Access button to copy code to stream this repository, then open the images/ folder with your preferred file browser to see the various prompts and images that people have saved in the past.

Duplicate to save to your own repository

Use Text-to-Image Generator as a starting point for your own GenAI app and customize away! Click the Duplicate button in the top right to make a copy of this project in your account. Use the Settings tab to set visibility to Private if you want to keep your images to yourself.

Once you have your own copy, develop locally with the tools of your choice:

Working with Xet CLI or PyXet

Copy the full repository to your machine:

xet cp -r xet://XetHub/Text-to-Image-Generator/main Text-to-Image-Generator

Or if you know the specific files you want to work with, copy them separately:

xet cp xet://XetHub/Text-to-Image-Generator/main Text-to-Image-Generator/

If you want to customize your app, follow the local setup instructions below and develop away. Once you're done, copy your changed files back to the repository.

xet cp <files> xet://<your username>/Text-to-Image-Generator/main -m "Some updates"

Then launch your app through the Capsules tab, changing the App Settings to set your OctoAI credentials (OCTOAI_TOKEN, OCTOAI_PUBLIC_ENDPOINT) as secrets prior to deployment.

Working with Git-Xet

Do a lazy clone of the repository, and materialize the placeholder images:

git xet clone --no-smudge https://xethub.com/<your username>/Text-to-Image-Generator.git

cd Text-to-Image-Generator
git xet checkout placeholders/

If you want to customize your app, follow the local setup instructions below and develop away. Once you're done, Git commit and push to update the repository.

Then launch your app through the Capsules tab, changing the App Settings to set your OctoAI credentials (OCTOAI_TOKEN, OCTOAI_PUBLIC_ENDPOINT) as secrets prior to deployment.

Local development setup

This app was developed with Python 3.9. Start by setting up your Python environment:

# create and activate a virtual environment
python -m venv venv
source venv/bin/activate

# install dependencies
pip install -r requirements.txt

Environment variables and configuration

We use OctoAI Compute for image generation. Sign up for an account and set these environment variables:

You can set these variables through the command line:

export OCTOAI_TOKEN=<token>
export OCTOAI_PUBLIC_ENDPOINT=<endpoint>

Or by creating a .env file with the following:

OCTOAI_TOKEN=<token>
OCTOAI_PUBLIC_ENDPOINT=<endpoint>

This app also requires XetHub environment variables to write back to the project. Export the following:

XET_USER_NAME=
XET_USER_TOKEN=
XET_USER_EMAIL=
File List Total items: 7
Name Last Commit Size Last Modified
images Write John_Cena_eating_ice_cream_2023-08-16T0205450000 1 year ago
placeholders copy placeholders to xet://XetHub/Text-to-Image-Generator/main/placeholders 1 year ago
.gitattributes Initial commit 79 B 1 year ago
README.md Update README 3.8 KiB 1 year ago
app.py copy app.py to xet://XetHub/Text-to-Image-Generator/main 7.2 KiB 1 year ago
config.py copy *.py to xet://XetHub/Text-to-Image-Generator/main 1019 B 1 year ago
requirements.txt copy requirements.txt to xet://XetHub/Text-to-Image-Generator/main 250 B 1 year ago

Repository Size

Loading repo size...

Commits 25 commits

File Types