Git Product home page Git Product logo

replicate-dreambooth-api's Introduction

FastAPI-based DreamBooth API

Description

This API is built using FastAPI and is designed to integrate with DreamBooth's AI models. It provides various endpoints for model training, running models, and querying their status.


Table of Contents


Setup

  1. Install FastAPI and other dependencies.
  2. Set your REPLICATE_TOKEN and WEBHOOK_URL as env variables.
  3. Optionally set DOCS_PASSWORD and DOCS_USERNAME for the fastapi docs page.
  4. DD_AGENT_HOST, DD_TRACE_AGENT_PORT and DATADOG_SERVICE_NAME to configure datadog.
  5. Set API_KEY to change api key for the endpoints.

Usage

Training a Model

Endpoint: POST /train_model/

Train a model by providing instance and class prompts, the maximum number of training steps, the model version, and the trainer version.

Required Fields:

  • instance_prompt (str)
  • class_prompt (str)
  • max_train_steps (int)
  • model (str)
  • trainer_version (str)
  • file (UploadFile) - Zip file for training data

Running a Model

Endpoint: POST /run_model/

Run an already trained model.

Required Fields:

  • RunInput - The input parameters to run the model. It is a Pydantic model.
  • version (str) - The version of the model to run.

Get Prediction

Endpoint: GET /get_prediction/

Get the prediction result from a given URL.

Parameters:

  • url (str) - The URL to fetch the prediction from.

Get Training Status

Endpoint: GET /get_training_status/{training_id}/

Get the current status of a training operation using its training ID.

Parameters:

  • training_id (str) - ID of the training operation

Webhook

Endpoint: POST /webhook/

This endpoint receives payload data related to model training.


API Endpoints

  • POST /train_model/
  • POST /run_model/
  • GET /get_prediction/
  • GET /get_training_status/{training_id}/
  • POST /webhook/

Dependencies

  • FastAPI
  • DreamBoothAPI
  • pydantic

Diagram

Diagram

replicate-dreambooth-api's People

Contributors

abdulzain6 avatar

Stargazers

Felipe Menegazzi avatar

Watchers

 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.