Skip to main content

Coconut AI

Project description

coconut-ai

About

Coconut AI is a Python library that allows you to use AUTOMATIC1111/Stable Diffusion Web API, to generate images from text or images to images.

The library is available on PyPy: https://pypi.org/project/coconut-ai/.

Getting Started

Prerequisites

Installation

pipenv install coconut-ai

Usage

For a complete example, see the coconut-ai-example repository.

# Go to AUTOMATIC1111/Stable Diffusion web UI source code
cd stable-diffusion-webui

# Run the AUTOMATIC1111/Stable Diffusion Web API
./webui.sh --api --nowebui

# Go to your Python project/source code
cd ../python-project
pipenv install coconut-ai

Create a file named main.py with the following content (minimal example):

import os

import coconut_ai

if __name__ == '__main__':
    print("Coconut AI")
    output_path = os.path.abspath("output.png")
    os.makedirs(os.path.dirname(output_path), exist_ok=True)
    coconut_ai.text_to_image({
        "input_text": "Coconut",
        "output_path": output_path,
        "steps": 5
    })

Run the script:

pipenv run python main.py

💡 Contributing

Anyone can help to improve the project, submit a Feature Request, a bug report or even correct a simple spelling mistake.

The steps to contribute can be found in the CONTRIBUTING.md file.

📄 License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coconut-ai-0.2.0.tar.gz (3.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page