Metadata-Version: 2.1
Name: py_leap_api
Version: 0.0.5
Summary: Unofficial Library to interact with TryLeap REST API
Home-page: https://github.com/IperGiove/py_leap_api
Author: ipergiove
Author-email: ipergiove@duck.com
Project-URL: Doc, https://docs.tryleap.ai/reference/inferencescontroller_create-1
Project-URL: Source, https://github.com/IperGiove/py_leap_api
Keywords: Leap,api,genrative,image
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.0
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.0.0, <4
Description-Content-Type: text/markdown
License-File: LICENSE

# TryLeap Python API
The py_leap_api Python package provides a simple interface for interacting with the TryLeap service, a cloud-based platform for generating images using artificial intelligence.

## Installation
You can install the py_leap_api package using pip:

```bash
pip install py_leap_api
```

## Getting Started
First, you'll need to create an account on the TryLeap website and obtain an API key.

Once you have an API key, you can use the TryLeap class to interact with the service. Here's a simple example that creates a model, uploads some images, and generates some images based on a prompt:

```python
from py_leap_api.leap import TryLeap

# Create a TryLeap object with your API key
api_key = "your-api-key"
leap = TryLeap(api=api_key)

# Create a model
model = await leap.create_model("My Model")
print(model)

# add the model id
leap.set_model(model=model["id"])

# Upload some images
urls = [
    "https://example.com/image1.png",
    "https://example.com/image2.png",
    "https://example.com/image3.png",
]
await leap.upload_images_url(urls)

# Train the model
queue = await leap.training_model()
print(queue)
```

Ideally if you have a webhook url you can provide it to training_model in order to know when the training finished.
Otherwise you can fetch the status that return from the function.

```python
# Generate some images
prompt = "a cat sitting on a couch"
response = await leap.generate_image(prompt, number_images=3)

# Retrieve the output images
output_images = await leap.output_images()
```

# License
This library is licensed under the MIT License. See the LICENSE file for details.
