Giter VIP home page Giter VIP logo

text-to-image's Introduction

Text-to-Image Plugin

ssd1b

Updates

  • 2023-12-19: Added support for Kandinsky-2.2 and Playground V2 models
  • 2023-11-30: Version 1.2.0
    • adds local model running via diffusers (>=0.24.0)
    • adds calling from the Python SDK!
    • ⚠️ BREAKING CHANGE: the plugin and operator URIs have been changed from ai_art_gallery to text_to_image. If you have any saved pipelines that use the plugin, you will need to update the URIs.
  • 2023-11-08: Version 1.1.0 adds support for DALLE-3 Model — upgrade to openai>=1.1.0 to use 😄
  • 2023-10-30: Added support for Segmind Stable Diffusion (SSD-1B) Model
  • 2023-10-23: Added support for Latent Consistency Model
  • 2023-10-18: Added support for SDXL, operator icon, and download location selection

Plugin Overview

This plugin is a Python plugin that allows you to generate images from text prompts and add them directly into your dataset.

⚠️ This plugin is only verified to work for local datasets. It may not work for remote datasets.

Supported Models

This version of the plugin supports the following models:

It is straightforward to add support for other models!

Watch On Youtube

Video Thumbnail

Installation

fiftyone plugins download https://github.com/jacobmarks/text-to-image

If you want to use Replicate models, you will need to pip install replicate and set the environment variable REPLICATE_API_TOKEN with your API token.

If you want to use DALL-E2 or DALL-E3, you will need to pip install openai and set the environment variable OPENAI_API_KEY with your API key.

To run the Latency Consistency model locally with Hugging Face's diffusers library, you will need diffusers>=0.24.0. If you need to, you can install it with pip install diffusers>=0.24.0.

Refer to the main README for more information about managing downloaded plugins and developing plugins locally.

Operators

txt2img

  • Generates an image from a text prompt and adds it to the dataset

Python SDK

You can also use the txt2img operators from the Python SDK!

⚠️ Due to the way Jupyter Notebooks interact with asyncio, this will not work in a Jupyter Notebook. You will need to run this code in a Python script or in a Python console.

import fiftyone as fo
import fiftyone.operators as foo
import fiftyone.zoo as foz

dataset = fo.load_dataset("quickstart")

## Access the operator via its URI (plugin name + operator name)
t2i = foo.get_operator("@jacobmarks/text_to_image/txt2img")

## Run the operator

prompt = "A dog sitting in a field"
t2i(dataset, prompt=prompt, model_name="latent-consistency", delegate=False)

## Pass in model-specific arguments
t2i(
    dataset,
    prompt=prompt,
    model_name="latent-consistency",
    delegate=False,
    width=768,
    height=768,
    num_inference_steps=8,
)

text-to-image's People

Contributors

jacobmarks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gamal4910

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.