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 details)

Uploaded Source

File details

Details for the file coconut-ai-0.2.0.tar.gz.

File metadata

  • Download URL: coconut-ai-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for coconut-ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a5c89051e224c526f1b8ac86c70269626b9769b067ef7f524e1bc38d07336296
MD5 72b90e9c865f4f2b9a583577e94f720d
BLAKE2b-256 e641f24acbabdd639b7808803bded940a292d87d31ed379d4a559f122e3ba52c

See more details on using hashes here.

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