Skip to content

davift/Image2Image

Repository files navigation

image2image

Image-to-Image is a technique of changing images guide by prompts with an initial image as main input.

Disclaimer: The code in this repository is capable of downloading and running multiple *uncensored models. Use with resposibility and respect!

Content of the readme.

  • Container
    • Build, Run, and Manage
  • Applications/Scripts
    • Benchmarking
      • Runs the same batch of prompts against all models for comparison.
    • CLI
      • Can generates muiltiple images fromt he same prompt,
      • Easy to integrate with other apps or automations,
      • Has a randomizer function for parameters (strength and guidance).
    • Web-UI
      • (incomplete)

Container

This container image includes all the required libraries and dependencies to run the models and scripts without any hassle. It is build based on PyTorch v2.1.2 for compatibility with NVIDIA Tesla P4 (Pascal architecture).

Build

docker build -t image2image:v1.0 .

Run in Background

docker run -itd --gpus all -v $(pwd):/app -v $(pwd)/../models:/models -p 7860:7860 --name Image2Image image2image:v1.0

Run in Background with Web-UI

docker run --rm -itd --gpus all -v $(pwd):/app -v $(pwd)/../models:/models -p 7860:7860 -e INDEX=1,23 --name Image2Image text2image:v1.0 /app/app.py

Managing

docker exec -it Image2Image bash
docker logs -f Image2Image
docker stop Image2Image
docker rm Image2Image

Application

Benchmarking

Running

./benchmark.py

CLI

Usage

INDEX=M,N python app.py input_file [prompt] [num_images] [num_saved_steps]

Note: INDEX refers to the model to be used, see code.

Examples

./app.py girl.png "dressed like a cat"
./app.py car.png "giant tires" 3
INDEX=1,23 ./app.py car.png "futuristic scenario" 0

Web-UI

./app.py

Navigate to http://IP:7860/

Avoid Duplication

This will rename all files to its MD5 hash to prevent duplication and tampering.

for f in *.png; do [ -f "$f" ] && h=$(md5sum "$f" | cut -d ' ' -f1) && mv -n -- "$f" "$h.png"; done

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors