Package: auto1111sdk
Auto 1111 SDK: Stable Diffusion Python libraryAuto 1111 SDK is a lightweight Python library for using Stable Diffusion generating images, upscaling images, and editing images with diffusion models. It is designed to be a modular, light-weight Python client that encapsulates all the main features of the [Automatic 1111 Stable Diffusion Web Ui](https://github.com/AUTOMATIC1111/stable-diffusion-webui). Auto 1111 SDK offers 3 main core features currently:Text-to-Image, Image-to-Image, Inpainting, and Outpainting pipelines. Our pipelines support the exact same parameters as theStable Diffusion Web UI, so you can easily replicate creations from the Web UI on the SDK.Upscaling Pipelines that can run inference for any Esrgan or Real Esrgan upscaler in a few lines of code.An integration with Civit AI to directly download models from the website.Join ourDiscord!!DemoWe have a colab demo where you can run many of the operations of Auto 1111 SDK. Check it outhere!!InstallationWe recommend installing Auto 1111 SDK in a virtual environment from PyPI. Right now, we do not have support for conda environments yet.pip3installauto1111sdkTo install the latest version of Auto 1111 SDK, run:pip3installgit+https://github.com/saketh12/Auto1111SDK.gitQuickstartGenerating images with Auto 1111 SDK is super easy. To run inference for Text-to-Image, Image-to-Image, Inpainting, Outpainting, or Stable Diffusion Upscale, we have 1 pipeline that can support all these operations. This saves a lot of RAM from having to create multiple pipeline objects with other solutions.fromauto1111sdkimportStableDiffusionPipelinepipe=StableDiffusionPipeline("<Path to your local safetensors or checkpoint file>")prompt="a picture of a brown dog"output=pipe.generate_txt2img(prompt=prompt,height=1024,width=768,steps=10)output[0].save("image.png")Running on WindowsFind the instructionshere.Contributed by by Marco Guardigli,mgua@tomware.itDocumentationWe have more detailed examples/documentation of how you can use Auto 1111 SDKhere.
For a detailed comparison between us and Huggingface diffusers, you can readthis.For a detailed guide on how to use SDXL, we recommend readingthisFeaturesOriginal txt2img and img2img modesReal ESRGAN upscale and Esrgan Upscale (compatible with any pth file)OutpaintingInpaintingStable Diffusion UpscaleAttention, specify parts of text that the model should pay more attention toa man in a((tuxedo))- will pay more attention to tuxedoa man in a(tuxedo:1.21)- alternative syntaxselect text and pressCtrl+UporCtrl+Down(orCommand+UporCommand+Downif you're on a MacOS) to automatically adjust attention to selected text (code contributed by anonymous user)Composable Diffusion: a way to use multiple prompts at onceseparate prompts using uppercase ANDalso supports weights for prompts: a cat :1.2 AND a dog AND a penguin :2.2Works with a variety of samplersDownload models directly from Civit AI and RealEsrgan checkpointsSet custom VAE: works for any model including SDXLSupport for SDXL with Stable Diffusion XL PipelinesPass in custom arguments to the modelsNo 77 prompt token limit (unlike Huggingface Diffusers, which has this limit)RoadmapAdding support Hires Fix and Refiner parameters for inference.Adding support for Lora'sAdding support for Face restorationAdding support for Dreambooth training script.Adding support for custom extensions like Controlnet.We will be adding support for these features very soon. We also accept any contributions to work on these issues!ContributingAuto1111 SDK is continuously evolving, and we appreciate community involvement. We welcome all forms of contributions - bug reports, feature requests, and code contributions.Report bugs and request features by opening an issue on Github.
Contribute to the project by forking/cloning the repository and submitting a pull request with your changes.CreditsLicenses for borrowed code can be found inSettings -> Licensesscreen, and also inhtml/licenses.htmlfile.Automatic 1111 Stable Diffusion Web UI -https://github.com/AUTOMATIC1111/stable-diffusion-webuiStable Diffusion -https://github.com/Stability-AI/stablediffusion,https://github.com/CompVis/taming-transformersk-diffusion -https://github.com/crowsonkb/k-diffusion.gitESRGAN -https://github.com/xinntao/ESRGANMiDaS -https://github.com/isl-org/MiDaSIdeas for optimizations -https://github.com/basujindal/stable-diffusionCross Attention layer optimization - Doggettx -https://github.com/Doggettx/stable-diffusion, original idea for prompt editing.Cross Attention layer optimization - InvokeAI, lstein -https://github.com/invoke-ai/InvokeAI(originallyhttp://github.com/lstein/stable-diffusion)Sub-quadratic Cross Attention layer optimization - Alex Birch (https://github.com/Birch-san/diffusers/pull/1), Amin Rezaei (https://github.com/AminRezaei0x443/memory-efficient-attention)Textual Inversion - Rinon Gal -https://github.com/rinongal/textual_inversion(we're not using his code, but we are using his ideas).Idea for SD upscale -https://github.com/jquesnelle/txt2imghdNoise generation for outpainting mk2 -https://github.com/parlance-zz/g-diffuser-botCLIP interrogator idea and borrowing some code -https://github.com/pharmapsychotic/clip-interrogatorIdea for Composable Diffusion -https://github.com/energy-based-model/Compositional-Visual-Generation-with-Composable-Diffusion-Models-PyTorchxformers -https://github.com/facebookresearch/xformersSampling in float32 precision from a float16 UNet - marunine for the idea, Birch-san for the example Diffusers implementation (https://github.com/Birch-san/diffusers-play/tree/92feee6)