Coder Social home page Coder Social logo

c-band / stability-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stability-ai/stability-sdk

0.0 0.0 0.0 19.52 MB

SDK for interacting with stability.ai APIs (e.g. stable diffusion inference)

License: MIT License

Python 3.88% Jupyter Notebook 96.12%

stability-sdk's Introduction

stability-clients

Open In Colab

Client implementations that interact with the Stability Generator API

Installation

Install the PyPI package via:

pip install stability-sdk

Python client

client.py is both a command line client and an API class that wraps the gRPC based API. To try the client:

  • Use Python venv: python3 -m venv pyenv
  • Set up in venv dependencies: pyenv/bin/pip3 install -r requirements.txt
  • pyenv/bin/enable to use the venv.
  • Set the STABILITY_HOST environment variable. This is by default set to the production endpoint grpc.stability.ai:443.
  • Set the STABILITY_KEY environment variable.

Then to invoke:

  • python3 client.py -W 512 -H 512 "A stunning house."

It will generate and put PNGs in your current directory.

SDK Usage

See usage demo notebooks in ./nbs

Command line usage

usage: client.py [-h] [--height HEIGHT] [--width WIDTH]
                 [--cfg_scale CFG_SCALE] [--sampler SAMPLER] [--steps STEPS]
                 [--seed SEED] [--prefix PREFIX] [--no-store]
                 [--num_samples NUM_SAMPLES] [--show]
                 prompt [prompt ...]

positional arguments:
  prompt

optional arguments:
  -h, --help            show this help message and exit
  --height HEIGHT, -H HEIGHT
                        [512] height of image
  --width WIDTH, -W WIDTH
                        [512] width of image
  --cfg_scale CFG_SCALE, -C CFG_SCALE
                        [7.0] CFG scale factor
  --sampler SAMPLER, -A SAMPLER
                        [k_lms] (ddim, plms, k_euler, k_euler_ancestral,
                        k_heun, k_dpm_2, k_dpm_2_ancestral, k_lms)
  --steps STEPS, -s STEPS
                        [50] number of steps
  --seed SEED, -S SEED  random seed to use
  --prefix PREFIX, -p PREFIX
                        output prefixes for artifacts
  --no-store            do not write out artifacts
  --num_samples NUM_SAMPLES, -n NUM_SAMPLES
                        number of samples to generate
  --show                open artifacts using PIL
  --engine, -e          engine to use for inference

stability-sdk's People

Contributors

dmarx avatar wbrown avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.