Skip to content

Unofficial implementation of Sketch-Guided Text-to-Image Diffusion Models

Notifications You must be signed in to change notification settings

sangminkim-99/Sketch-Guided-Text-To-Image

Repository files navigation

Sketch-Guided Text-to-Image Diffusion Models

This repository contains an unofficial implementation of Google's paper Sketch-Guided Text-to-Image Diffusion Models. The goal of this project is to generate high-quality images from textual descriptions and corresponding sketches.

References

This implementation was inspired by and references the following repositories:

Overview

The Sketch-Guided Text-to-Image Diffusion Models project focuses on generating realistic images from textual descriptions and corresponding sketches.

Installation

  1. Clone the repository:
git clone --recurse-submodules https://github.com/sangminkim-99/Sketch-Guided-Text-To-Image.git
cd Sketch-Guided-Text-To-Image
  1. Create and activate a new Conda environment:
conda create -n sketch-guided-env python=3.9
conda activate sketch-guided-env
  1. Install the necessary dependencies. You may use pip to install the required packages:
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia # change to your own version of torch
pip install -r requirements.txt
  1. Download necessary datasets.

    chmod u+x scripts/download_imagenet_room_dataset.sh
    ./scripts/download_imagenet_room_dataset.sh
    chmod u+x scripts/generate_edge_map.sh
    ./scripts/generate_edge_map.sh

Usage

  • Show helper messages for all possible commands
python app.py --help
  • Train Latent Edge Predictor

Currently supports --batch-size 1 only.

python app.py train-lep
  • Sample image with Latent Edge Predictor
python app.py sample --sketch-file-path {PATH} --prompt {PROMPT}
  • Gradio web demo (debugging)
python app.py demo

TODOs

  • Reproduce the bicycle example

  • Upload pretrained LEP

Acknowledgments

We would like to express our gratitude to the authors of the original paper and the developers of the referenced repositories for their valuable contributions, which served as the foundation for this implementation.

Disclaimer

This is an unofficial implementation and is not affiliated with Google or the authors of the original paper.

About

Unofficial implementation of Sketch-Guided Text-to-Image Diffusion Models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published