Visionary-AI is a small, flexible toolkit for generating images from text prompts using modern image-generation models. It provides a CLI and a minimal web UI (if included in the repo) to quickly turn prompts into high-quality images, plus sensible defaults and configuration for local or cloud inference.
Note: This README is a general, practical guide. Adjust environment variables, commands, or model names to match the implementation in the repository if necessary.
- Generate images from text prompts
- Support for configurable model backends (local / cloud API)
- Batch generation and prompt templates
- Simple CLI and optional web UI
- Output management: set resolution, number of steps, seeds, and output folder
- Configurable via environment variables or a config file
- Installation
- Quickstart
- Usage
- Configuration
- Examples
- Developing
- Contributing
- License
- Acknowledgements
Prerequisites:
- Python 3.8+ (or the version used in this repo)
- pip
- (Optional) A GPU + CUDA for local model inference
From the repository:
-
Clone the repo git clone https://github.com/mohas8/Visionary-AI-AI-Image-Generator.git cd Visionary-AI-AI-Image-Generator
-
Create and activate a virtual environment (recommended) python -m venv .venv source .venv/bin/activate # macOS/Linux .venv\Scripts\activate # Windows
-
Install dependencies pip install -r requirements.txt
If the project provides a Dockerfile: docker build -t visionary-ai . docker run --rm -e MODEL_API_KEY=$MODEL_API_KEY -p 7860:7860 visionary-ai
Basic CLI usage (adjust command to match actual CLI script in the repo):
Generate a single image from a prompt: python -m visionary main --prompt "A photorealistic red fox sitting in a snowy forest at sunrise" --out outputs/
Generate 4 images at 512x512: python -m visionary main --prompt "Surreal painting of a city made of glass" --n_samples 4 --width 512 --height 512 --out outputs/
If the project uses an external API (OpenAI / Replicate / Stability / other), set the API key first: export MODEL_API_KEY="your_api_key_here"
$env:MODEL_API_KEY="your_api_key_here"
CLI
- The repository contains a CLI entrypoint (e.g., visionary/main.py or scripts/generate.py). Run it with
--helpto list supported flags: python -m visionary --help
Common flags:
- --prompt : text prompt to generate from
- --out / --output-dir : directory to save generated images
- --width / --height : output image size
- --n_samples / --count : number of images to generate
- --seed : random seed for reproducibility
- --model : choose the backend/model name (if supported)
Web UI
- If a web UI is included, start it with: python -m visionary.web --port 7860
- Open your browser at http://localhost:7860
Python API
-
If the repo exposes a library-like interface, you can generate images from Python: from visionary import Generator
gen = Generator(api_key=os.environ.get("MODEL_API_KEY"), model="stable-diffusion") images = gen.generate("A fantasy castle on a floating island", width=512, height=512)
Check the repository's modules for exact class/function names.
You can configure the tool via environment variables or a config file (config.yml or .env). Typical settings:
- MODEL_API_KEY — API key for cloud model backends
- MODEL_BACKEND — e.g., local, openai, replicate, stability
- MODEL_NAME — model identifier (e.g., "stable-diffusion-v1-4")
- OUTPUT_DIR — default directory for outputs
- DEVICE — cpu, cuda:0, etc.
- SAMPLES_PER_PROMPT — default number of images to generate
Example .env: MODEL_API_KEY=sk-xxxxxxxxxxxx MODEL_BACKEND=replicate MODEL_NAME=stability-ai/stable-diffusion OUTPUT_DIR=outputs DEVICE=cuda:0
-
Single-prompt generation: python -m visionary main --prompt "A cyberpunk skyline at night, neon reflections" --n_samples 1
-
Batch prompts from file: python -m visionary main --prompts-file prompts.txt --n_samples 2 --out outputs/
-
Reproducible output: python -m visionary main --prompt "Minimalist poster of a whale" --seed 42 --n_samples 1
- Start with lower resolutions for fast iteration (256–512).
- Use seeds to reproduce results.
- Use prompt templates and negative prompts (if supported) to refine outputs.
- If using cloud APIs, watch your usage/costs and set rate limits if supported.
-
Run tests (if included): pytest
-
Linting and formatting: black . flake8
-
Add new models or backends by implementing an adapter class that follows the repository's model interface (look for model/ or backends/ directory).
- Out of memory on GPU: lower width/height or batch size; switch to CPU if necessary.
- Slow generation: use a smaller model, lower sampling steps, enable caching.
- Authentication errors: confirm MODEL_API_KEY is set and valid for the chosen backend.
Contributions are welcome. Please:
- Open an issue describing the change or bug.
- Create a feature branch.
- Open a pull request with tests and documentation updates.
Follow repository coding style and include meaningful commit messages.
MIT
- Built with gratitude to the open-source model & community ecosystem.
- Mention any third-party libraries or model providers used in the repo (Hugging Face, Stability, OpenAI, Replicate, etc.)
For questions or help, open an issue or contact the maintainer: @mohas8