nordwestt / odingo

Repository from Github https://github.comnordwestt/odingoRepository from Github https://github.comnordwestt/odingo

odingo - local image generation server

This is a local server for image generation, in the same way that Ollama is a local server for text generation, compliant with the OpenAI image generation API.

It uses Hugging Face's diffusers library to pull models from Hugging Face's model hub and generate images.

To install

Install dependencies using uv (which automatically manages the virtual environment):

uv sync

If you don't have uv installed, install it first:

curl -LsSf https://astral.sh/uv/install.sh | sh

Note: This project now uses uv for dependency management. The old requirements.txt file is kept for reference, but all dependencies are now managed through pyproject.toml.

To run

Run the server using uv:

uv run uvicorn src.main:app --reload

Development

Install development dependencies

uv sync --dev

Run tests (if any)

uv run pytest

Add new dependencies

# Add a runtime dependency
uv add package-name

# Add a development dependency
uv add --dev package-name

Update dependencies

uv sync --upgrade

To use

List installed models

curl http://localhost:8000/models/list

Pull a model

curl -X POST http://localhost:8000/models/pull -d '{"url": "https://huggingface.co/CompVis/stable-diffusion-v1-4"}'

Delete a model

curl -X DELETE http://localhost:8000/models/CompVis/stable-diffusion-v1-4

Generate an image

curl -X POST http://localhost:8000/v1/images/generations -d '{"prompt": "A beautiful image of a cat", "n": 1, "size": "512x512", "model": "stable-diffusion-v1-5/stable-diffusion-v1-5", "response_format":"b64_json"}' --header "Content-Type: application/json"

About


Languages

Language:Python 98.3%Language:Shell 1.7%