This image generation tool uses Stable Diffusion and Generative Adversarial Network (GAN). Take a look at the demo on Google Colab (Google Chrome is preferred).
Note: Use Python 3.10 or above.
-
Install PyTorch (find a version that suits you most).
-
Clone this repository and change directory:
git clone https://github.com/anson416/image-generator.git cd image-generator
-
Download Real-ESRGAN models (realesr-general-x4v3.pth , realesr-general-wdn-x4v3.pth , RealESRGAN_x4plus.pth ) to
./imgen/gan/realesrgan/weights
(backup). -
Install
imgen
:python -m pip install -e .
Suggested prefix: "(((masterpiece))), (((best quality))), ((ultra-detailed)), ((8k))"
If you want to prevent NSFW content, you can add "(family friendly:0.85)" after the above prefix.
Suggested prefix: "lowres, worst quality, low quality, standard quality, error, jpeg artifacts, blurry, username, signature, watermark, text"
If you want to prevent NSFW content, you can insert "((nsfw)), ((nude))" before the above prefix.
- BasicSR: An open-source image and video restoration toolbox based on PyTorch.
- Real-ESRGAN: A practical algorithm for general image/video restoration.