GithubHelp home page GithubHelp logo

nanyisong / docker-prompt-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soulteary/docker-prompt-generator

0.0 0.0 0.0 1.84 MB

Using a Model to generate prompts for Model applications. / 使用模型来生成作图咒语的偷懒工具,支持 MidJourney、Stable Diffusion 等。

Home Page: https://soulteary.com/2023/04/05/eighty-lines-of-code-to-implement-the-open-source-midjourney-and-stable-diffusion-spell-drawing-tool.html

License: MIT License

Python 100.00%

docker-prompt-generator's Introduction

Docker Prompt Generator

中文文档

Using a Model to generate prompts for Model applications (MidJourney, Stable Diffusion, etc...)

Preview

Like the official Mid Journey function, it supports parsing prompts from images and secondary extensions based on prompts.

Support writing prompts directly in Chinese, and then get prompts text that can be used for better effect generation.

Usage

In the past several articles, I mentioned my personal habits and recommended development environment, which is based on Docker and Nvidia's official base container for deep learning environments. I won't go into details about that here, but if you're interested, you can check out articles like this one on getting started with Docker-based deep learning environments. I believe that long-time readers should already be quite familiar with it.

Of course, since this article includes parts that can be played with just a CPU, you can also refer to Playing with the Stable Diffusion Model on MacBook Devices with M1 and M2 chips from a few months ago to configure your environment.

Once you have prepared the Docker environment configuration, we can continue to have fun.

Find a suitable directory and use git clone or download the Zip archive to get the "Docker Prompt Generator" project code onto your local machine.

git clone https://github.com/soulteary/docker-prompt-generator.git
# or
curl -sL -o docker-prompt-generator.zip https://github.com/soulteary/docker-prompt-generator/archive/refs/heads/main.zip

Next, enter the project directory and use Nvidia's official PyTorch Docker base image to build the basic environment. Compared to pulling a pre-made image directly from DockerHub, building it yourself will save a lot of time.

Execute the following commands in the project directory to complete the model application build:

# Build the base image
docker build -t soulteary/prompt-generator:base . -f docker/Dockerfile.base

# Build the CPU application
docker build -t soulteary/prompt-generator:cpu . -f docker/Dockerfile.cpu

# Build the GPU application
docker build -t soulteary/prompt-generator:gpu . -f docker/Dockerfile.gpu

Then, depending on your hardware environment, selectively execute the following commands to start a model application with a Web UI interface.

# Run the CPU image
docker run --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 --rm -it -p 7860:7860 soulteary/prompt-generator:cpu

# Run the GPU image
docker run --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 --rm -it -p 7860:7860 soulteary/prompt-generator:gpu

Enter the IP address of the host running the container in your browser, and you can start using the tool.

Credits

Models:

Datasets:

docker-prompt-generator's People

Contributors

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