Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Latest commit

 

History

History

python

livepeer-ai

An application to run AI pipelines

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.1.0
  • Package version: 1.0.0
  • Generator version: 7.5.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import livepeer_ai

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import livepeer_ai

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import livepeer_ai
from livepeer_ai.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://dream-gateway.livepeer.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = livepeer_ai.Configuration(
    host = "https://dream-gateway.livepeer.cloud"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: HTTPBearer
configuration = livepeer_ai.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with livepeer_ai.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = livepeer_ai.DefaultApi(api_client)
    prompt = 'prompt_example' # str | 
    image = None # bytearray | 
    model_id = '' # str |  (default to '')
    strength = 0.8 # float |  (optional) (default to 0.8)
    guidance_scale = 7.5 # float |  (optional) (default to 7.5)
    image_guidance_scale = 1.5 # float |  (optional) (default to 1.5)
    negative_prompt = '' # str |  (optional) (default to '')
    safety_check = True # bool |  (optional) (default to True)
    seed = 56 # int |  (optional)
    num_images_per_prompt = 1 # int |  (optional) (default to 1)

    try:
        # Image To Image
        api_response = api_instance.image_to_image(prompt, image, model_id, strength=strength, guidance_scale=guidance_scale, image_guidance_scale=image_guidance_scale, negative_prompt=negative_prompt, safety_check=safety_check, seed=seed, num_images_per_prompt=num_images_per_prompt)
        print("The response of DefaultApi->image_to_image:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DefaultApi->image_to_image: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://dream-gateway.livepeer.cloud

Class Method HTTP request Description
DefaultApi image_to_image POST /image-to-image Image To Image
DefaultApi image_to_video POST /image-to-video Image To Video
DefaultApi text_to_image POST /text-to-image Text To Image
DefaultApi upscale POST /upscale Upscale

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

HTTPBearer

  • Type: Bearer authentication

Author