Skip to content

nglcobdai/text2image

Repository files navigation

text2image

This is a Library to generate images from text.

License LICENSE
Environment Ubuntu
Docker Docker Compose
CUDA Python Poetry
Technology Hugging Face

Demo

Example of generated images.

A cat in a hat The photo of Tokyo Tower
Generated Image Generated Image

Requirements

  • Docker and docker-compose are required. The versions are as follows.

    • Docker: v26.0.2
    • Docker Compose: v2.22.0
  • Nvidia Driver is required for CUDA 12.5.

Getting Started

1. Clone Repository

$ git clone git@github.com:nglcobdai/text2image.git
$ cd text2image

2. Create .env file

Copy .env.example to .env

$ cp .env.example .env.dev

Edit .env.dev file

Key Description
DATADRIVE The path to the directory where generated image save.
HUGGINGFACE_API_TOKEN The API token for Hugging Face.
This token is required to access the FLUX.1-dev model.

3. Docker Build & Run

$ docker-compose build --no-cache
$ docker-compose run --rm dev

4. Run Python Script

$ python src/__main__.py

Releases

No releases published