Git Product home page Git Product logo

chatsd's Introduction

ChatSD


ChatSD is designed to make image generation tasks easily.

ChatSD is based on LLM(Large Language Model) and Stable Diffusion model. So when you communicate with ChatSD, it can understand your intentions and interpret them to appropriate prompts, and pass them into Stable Diffusion model for image generation.

At this point, ChatSD uses ChatGLM-6B and Openjourney, it may support more LLMs and Diffusion models in the future. (Note: this is a project for me to understand llm/diffusion/langchain better)

Quick Start

  1. Clone the project and go to the project workspace:
# clone the project
git clone ....

# go to directory
cd ChatSD
  1. Create a conda environment named chatsd and activate it:
# create a environment named `chatsd` and activate it
conda env create -f environment.yaml
conda activate chatsd

Note: if you want to remove the environment, then execute:

conda deactivate
conda remove -n chatsd --all
  1. Install the cuda version of torch:

refer to https://pytorch.org/ and execute:

## cuda version 11.8
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
  1. Run the main.py script:
python main.py

Note: run the script will download pretrained models from Hugging Face, and if the download process is interrupted due to the unstable network, you can re-execute the script for multiple times for downloading the models continuously.

If you want to input your instructions to ChatSD, then execute:

python main.py --input "Generate an image of cat for me" --grid_rows 2 --grid_cols 2 --image_output_dir "images"

Examples

I want to generate a logo for this project, so I execute the following command for 4 times:

python main.py --input "logo of cat, cute, happy, smile" --grid_rows=3 --grid_cols=3

and the results are:

cat_logo

Acknowledgement

I appreciate the open source of the following projects. Thanks to all the developers, your efforts make the world a better place:

visual-chatgptHugging FaceLangChainStable DiffusionChatGLM-6Bclip-interrogatortext2image-prompt-generatorprompt-generatoropenjourney

chatsd's People

Contributors

axzml 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.