ahrm / UnstableFusion
- понедельник, 26 сентября 2022 г. в 00:36:26
A Stable Diffusion desktop frontend with inpainting, img2img and more!
A Stable Diffusion desktop frontend with inpainting, img2img and more!
pip
). The dependencies include :PyQt5
, numpy
, pytorch
, Pillow
, opencv-python
, requests
, flask
, diffusers
, transformers
, protobuf
Note that if you want to run StableDiffusion locally, you have to install pytorch with cuda enabled like this:
pip install torch==1.12.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html
Note: On linux, if you encounter Could not load the Qt platform plugin "xcb"
error, run this:
pip uninstall opencv-python (solve a xcb compatibility issue)
pip install opencv-python-headless (solve a xcb compatibility issue)
Create a huggingface account and an access token, if you haven't done so already. Request access to the StableDiffusion model at CompVis/stable-diffusion-v1-4.
Clone this repository and run python unstablefusion.py
Install the dependencies (see the previous section)
Open this notebook and run it (you need to enter your huggingface token when asked).
When you run the last cell, you will be given a url like this:
Run python unstablefusion.py
In the runtime section, select server and enter the address you copied in the server field. Like this:
Select Color
button)prompt
text field and press the Generate button
(inpainting and reimagining work similarly)undo
/redo
button or pressing Control+Z
/Control+Shift+Z
on your keyboard. In fact most other functions are bound to keys as well (you can configure them in keys.json
file)Increase Size
/Decrease Size
buttons adjust the size of the image by adding/removing extra space in the margins (and not by scaling, this is useful when you want to add more detail around an image)Show Scratchpad
button. This window is capable of doing everything the main window can (using keyboard shortcuts only). The selected box in scratch pad will be mirrored and scaled into the selected box in the main window.
This is useful when trying to import another generated/local image into the main image.