Skip to main content

napari-stable-diffusion

License BSD-3 PyPI Python Version tests codecov napari hub

A demo of stable diffusion in napari.


This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.

demo image of napari-stable-diffusion of the prompt "a unicorn and a dinosaur eating cookies and drinking tea"

Installation

You can install napari-stable-diffusion via pip:

pip install napari-stable-diffusion

To install latest development version :

pip install git+https://github.com/kephale/napari-stable-diffusion.git

You will also need to sign up with HuggingFace and generate an access token to get access to the Stable Diffusion model we use.

When you have generated your access token you can either permanently set the HF_TOKEN_SD environment variable in your .bashrc or whichever file your OS uses, or you can include it on the command line

HF_TOKEN_SD="hf_aaaAaaaasdadsadsaoaoaoasoidijo" napari

For more information on the Stable Diffusion model itself, please see https://huggingface.co/CompVis/stable-diffusion-v1-4.

Apple M1 specific instructions

To utilize the M1 GPU, the nightly version of PyTorch needs to be installed. Consider using conda or mamba like this:

mamba create -c pytorch-nightly -n napari-stable-diffusion python=3.9 pip pyqt pytorch torchvision
pip install git+https://github.com/kephale/napari-stable-diffusion.git

Next steps

  • Image 2 Image support
  • Inpainting support

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the BSD-3 license, "napari-stable-diffusion" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Metadata

Release files for napari-stable-diffusion 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-stable-diffusion 0.1.1
File Size Uploaded
napari-stable-diffusion-0.1.1.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for napari-stable-diffusion 0.1.1
File Interpreter ABI Platform
napari_stable_diffusion-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.6 kB

Release files / napari-stable-diffusion-0.1.1.tar.gz

Download URL napari-stable-diffusion-0.1.1.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d2070c624e43aad3185db1e3998a217df29b372be513c42a188d561def7468a6
BLAKE2b-256 checksum
How to use checksums
7639cf02846fe6e994cf4833f61858c4aeeb4e61bf0bac813aec0ffd2719044c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release files / napari_stable_diffusion-0.1.1-py3-none-any.whl

Download URL napari_stable_diffusion-0.1.1-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b726ea58eadb3af000ffd76f8deb721610ae5d77e776d79605464673807fa91
BLAKE2b-256 checksum
How to use checksums
b7ddde45d0307f9f70a9d4dbac80ce527ba89896e682f8d5ac17198962ea418b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page