Skip to content

pytesin/stablediffusion-infinity

 
 

Repository files navigation

stablediffusion-infinity

Outpainting with Stable Diffusion on an infinite canvas.

Open In Colab Hugging Face Spaces Setup Locally

Start with init_image (updated demo in Gradio):

Girl.with.a.Pearl.Earring.mp4

Status

This project mainly works as a proof of concept. In that case, the UI design is relatively weak, and the quality of results is not guaranteed. You may need to do prompt engineering or change the size of the selection box to get better outpainting results.

The project now becomes a web app based on PyScript and Gradio. For Jupyter Notebook version, please check out the ipycanvas branch.

Pull requests are welcome for better UI control, ideas to achieve better results, or any other improvements.

Update: the project also supports glid-3-xl-stable as inpainting/outpainting model. Note that you have to restart the app.py to change model. (not supported on colab)

Update: the project add photometric correction to suppress seams, to use this feature, you need to install fpie: pip install fpie (Linux/MacOS only)

Docs

Get Started

FAQs

  • The result is a black square:
    • False positive rate of safety checker is relatively high, you may disable the safety_checker
  • What is the init_mode
    • init_mode indicates how to fill the empty/masked region, usually patch_match is better than others
  • Why not use postMessage for iframe interaction
    • The iframe and the gradio are in the same origin. For postMessage version, check out gradio-space version

Credit

The code of perlin2d.py is from https://stackoverflow.com/questions/42147776/producing-2d-perlin-noise-with-numpy/42154921#42154921 and is not included in the scope of LICENSE used in this repo.

The submodule glid_3_xl_stable is based on https://github.com/Jack000/glid-3-xl-stable

The submodule PyPatchMatch is based on https://github.com/vacancy/PyPatchMatch

The code of postprocess.py and process.py is modified based on https://github.com/Trinkle23897/Fast-Poisson-Image-Editing

About

Outpainting with Stable Diffusion on an infinite canvas

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 82.5%
  • HTML 7.9%
  • JavaScript 4.4%
  • Jupyter Notebook 2.7%
  • Shell 1.9%
  • Dockerfile 0.6%