Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stable-diffusion example using panel #254

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c951be6
Add stable-diffusion example with panel widgets
sandhujasmine Jan 30, 2023
aa3f94d
rename to change - to _
sandhujasmine Feb 2, 2023
c81806e
delete .projectignore since its not needed
sandhujasmine Feb 2, 2023
1076779
fix name; remove deployment and unused parts
sandhujasmine Feb 2, 2023
a91564c
Merge branch 'main' into stable-diffusion
sandhujasmine Feb 2, 2023
90d37bc
Add min versions based on solved spec
sandhujasmine Feb 2, 2023
8c3daf1
Add lock file; define min package versions in spec
sandhujasmine Feb 8, 2023
881108c
Use cuda if available. Should allow CI to run notebook
sandhujasmine Feb 8, 2023
127a676
Updated as panel Viewer class (thanks @philippjfr!)
sandhujasmine Feb 10, 2023
9815d86
Removed metadata per review comments.
sandhujasmine Feb 10, 2023
c44692c
Quick test to see if updating conda fixes the libmamba CI issue
sandhujasmine Feb 13, 2023
2765d63
Merge branch 'stable-diffusion' of github.com:pyviz-topics/examples i…
sandhujasmine Feb 13, 2023
ea2ace6
add check for mps; fix app so copy/paste URL works to regenerate image
sandhujasmine Feb 15, 2023
dbe639a
Merge branch 'stable-diffusion' of github.com:pyviz-topics/examples i…
sandhujasmine Feb 15, 2023
aecb8e5
Revert "Quick test to see if updating conda fixes the libmamba CI issue"
sandhujasmine Feb 15, 2023
4574430
Merge branch 'main' into stable-diffusion
sandhujasmine Feb 15, 2023
71c1a19
Fix torch API calls to check MPS availability
sandhujasmine Feb 16, 2023
5c99f00
Make computation more efficient
sandhujasmine Feb 19, 2023
01e147d
remove pins for now so conda solve works
sandhujasmine Feb 19, 2023
2428a39
generate on prompt enter as well
sandhujasmine Feb 20, 2023
891b997
make gallery a grid; add diffusers logo
sandhujasmine Feb 27, 2023
7d30c94
Define env_spec for stable-diffusion-m1 so it works on osx & linux
sandhujasmine Feb 27, 2023
e5cd512
cropped diffusers logo
sandhujasmine Feb 28, 2023
327d761
lock file incorrect for osx; remove it.
sandhujasmine Feb 28, 2023
3bd3608
Updated the documentation
sandhujasmine Feb 28, 2023
7d1305d
remove future improvements section
sandhujasmine Feb 28, 2023
78bcb9a
remove empty cell and add some more documentation
sandhujasmine Feb 28, 2023
5dbcaab
Clean up
sandhujasmine Feb 28, 2023
bbf2bb1
Fixed so it works on linux with cpu only
sandhujasmine Mar 1, 2023
54ed516
yet another lock file which seems to work on both (linux-64, osx)
sandhujasmine Mar 1, 2023
b22bd84
limit history of thumbnails to 15
sandhujasmine Mar 2, 2023
c355008
Load old image from memory; invoke callback on prompt or button; clean
sandhujasmine Mar 6, 2023
94457c0
Add label to random seed
sandhujasmine Mar 7, 2023
73c0135
Add commands to run on M1
sandhujasmine Mar 7, 2023
a9965e2
updated docs
sandhujasmine Mar 8, 2023
fff4a7a
Add description for the commands
sandhujasmine Mar 9, 2023
883ba6c
Update thumbnail
sandhujasmine Mar 9, 2023
0b6f286
Merge branch 'main' into stable-diffusion
maximlt Mar 12, 2023
565d0b0
Updated and cleaned up
jbednar Apr 26, 2023
7684f01
Merge branch 'main' into stable-diffusion
maximlt Apr 30, 2023
a53bf2b
declare no data ingestion
maximlt Apr 30, 2023
9782015
resize image
maximlt Apr 30, 2023
eea71a6
clean up project file
maximlt Apr 30, 2023
8b95eb2
linting fixes
maximlt Apr 30, 2023
9df5d24
Merge branch 'main' into stable-diffusion
maximlt Apr 30, 2023
e5ad566
temporary skip tests
maximlt Apr 30, 2023
7495758
allow skip_test
maximlt Apr 30, 2023
261ea35
run on macos
maximlt Apr 30, 2023
a825edb
point to the general environment file
maximlt Apr 30, 2023
19f3ed4
Revert "point to the general environment file"
maximlt May 1, 2023
5a4f3e0
Revert "run on macos"
maximlt May 1, 2023
ccfe2bc
Revert "allow skip_test"
maximlt May 1, 2023
edf9a33
Revert "temporary skip tests"
maximlt May 1, 2023
4944738
Merge branch 'main' into stable-diffusion
maximlt May 1, 2023
f681c77
test and build on macos-latest
maximlt May 1, 2023
f1214d6
[relaunch build]
maximlt May 1, 2023
83a18ec
[debug]
maximlt May 2, 2023
5db5619
checkout original branch
maximlt May 2, 2023
2697e32
undebug
maximlt May 2, 2023
c1bf92b
Merge branch 'main' into stable-diffusion
maximlt May 2, 2023
d0cb627
Fix link and add a link to huggingface article on memory
sandhujasmine May 10, 2023
6faab85
Merge branch 'main' into stable-diffusion
maximlt May 16, 2023
6972c11
Merge branch 'main' into stable-diffusion
maximlt Jun 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 258 additions & 0 deletions stable_diffusion/anaconda-project-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
# This is an Anaconda project lock file.
# The lock file locks down exact versions of all your dependencies.
#
# In most cases, this file is automatically maintained by the `anaconda-project` command or GUI tools.
# It's best to keep this file in revision control (such as git or svn).
# The file is in YAML format, please see http://www.yaml.org/start.html for more.
#

#
# Set to false to ignore locked versions.
#
locking_enabled: true

#
# A key goes in here for each env spec.
#
env_specs:
default:
locked: true
env_spec_hash: d9bb9c4d8e41175dbf4f384f8c3cd938099314f5
platforms:
- linux-64
packages:
linux-64:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=2_kmp_llvm
- aiohttp=3.8.3=py311hd4cff14_1
- aiosignal=1.3.1=pyhd8ed1ab_0
- anyio=3.6.2=pyhd8ed1ab_0
- argon2-cffi-bindings=21.2.0=py311hd4cff14_3
- argon2-cffi=21.3.0=pyhd8ed1ab_0
- arrow-cpp=11.0.0=ha770c72_2_cpu
- asttokens=2.2.1=pyhd8ed1ab_0
- async-timeout=4.0.2=pyhd8ed1ab_0
- attrs=22.2.0=pyh71513ae_0
- aws-c-auth=0.6.23=h7c1ec98_1
- aws-c-cal=0.5.20=ha1c5a7c_4
- aws-c-common=0.8.9=h0b41bf4_0
- aws-c-compression=0.2.16=h1afc718_1
- aws-c-event-stream=0.2.18=h6620826_2
- aws-c-http=0.7.3=h33879ea_1
- aws-c-io=0.13.14=hf82dcb6_3
- aws-c-mqtt=0.8.6=hdd1a3fa_1
- aws-c-s3=0.2.3=h5f5417b_3
- aws-c-sdkutils=0.1.7=h1afc718_1
- aws-checksums=0.1.14=h1afc718_1
- aws-crt-cpp=0.18.16=hf9eb7b6_13
- aws-sdk-cpp=1.10.57=h063c87b_2
- backcall=0.2.0=pyh9f0ad1d_0
- backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
- backports=1.0=pyhd8ed1ab_3
- beautifulsoup4=4.11.2=pyha770c72_0
- bleach=6.0.0=pyhd8ed1ab_0
- bokeh=2.4.3=pyhd8ed1ab_3
- brotlipy=0.7.0=py311hd4cff14_1005
- bzip2=1.0.8=h7f98852_4
- c-ares=1.18.1=h7f98852_0
- ca-certificates=2022.12.7=ha878542_0
- certifi=2022.12.7=pyhd8ed1ab_0
- cffi=1.15.1=py311h409f033_3
- charset-normalizer=2.1.1=pyhd8ed1ab_0
- click=8.1.3=unix_pyhd8ed1ab_2
- colorama=0.4.6=pyhd8ed1ab_0
- comm=0.1.2=pyhd8ed1ab_0
- cryptography=39.0.1=py311h9b4c7bb_0
- cudatoolkit=11.8.0=h37601d7_11
- cudnn=8.4.1.50=hed8a83a_0
- dataclasses=0.8=pyhc8e2a94_3
- datasets=2.9.0=pyhd8ed1ab_0
- debugpy=1.6.6=py311hcafe171_0
- decorator=5.1.1=pyhd8ed1ab_0
- defusedxml=0.7.1=pyhd8ed1ab_0
- diffusers=0.12.1=pyhd8ed1ab_0
- dill=0.3.6=pyhd8ed1ab_1
- entrypoints=0.4=pyhd8ed1ab_0
- executing=1.2.0=pyhd8ed1ab_0
- filelock=3.9.0=pyhd8ed1ab_0
- flit-core=3.8.0=pyhd8ed1ab_0
- freetype=2.12.1=hca18f0e_1
- frozenlist=1.3.3=py311hd4cff14_0
- fsspec=2023.1.0=pyhd8ed1ab_0
- ftfy=6.1.1=pyhd8ed1ab_0
- gflags=2.2.2=he1b5a44_1004
- glog=0.6.0=h6f12383_0
- huggingface_hub=0.12.0=pyhd8ed1ab_0
- icu=70.1=h27087fc_0
- idna=3.4=pyhd8ed1ab_0
- importlib-metadata=6.0.0=pyha770c72_0
- importlib_metadata=6.0.0=hd8ed1ab_0
- importlib_resources=5.10.2=pyhd8ed1ab_0
- ipykernel=6.21.1=pyh210e3f2_0
- ipython=8.9.0=pyh41d4057_0
- ipython_genutils=0.2.0=py_1
- jedi=0.18.2=pyhd8ed1ab_0
- jinja2=3.1.2=pyhd8ed1ab_1
- joblib=1.2.0=pyhd8ed1ab_0
- jpeg=9e=h166bdaf_2
- jsonschema=4.17.3=pyhd8ed1ab_0
- jupyter_client=8.0.2=pyhd8ed1ab_0
- jupyter_core=5.2.0=py311h38be061_0
- jupyter_events=0.6.3=pyhd8ed1ab_0
- jupyter_server=2.2.1=pyhd8ed1ab_0
- jupyter_server_terminals=0.4.4=pyhd8ed1ab_1
- jupyterlab_pygments=0.2.2=pyhd8ed1ab_0
- keyutils=1.6.1=h166bdaf_0
- krb5=1.20.1=h81ceb04_0
- lcms2=2.14=hfd0df8a_1
- ld_impl_linux-64=2.40=h41732ed_0
- lerc=4.0.0=h27087fc_0
- libabseil=20220623.0=cxx17_h05df665_6
- libarrow=11.0.0=hadd514c_2_cpu
- libblas=3.9.0=16_linux64_openblas
- libbrotlicommon=1.0.9=h166bdaf_8
- libbrotlidec=1.0.9=h166bdaf_8
- libbrotlienc=1.0.9=h166bdaf_8
- libcblas=3.9.0=16_linux64_openblas
- libcrc32c=1.1.2=h9c3ff4c_0
- libcurl=7.87.0=hdc1c0ab_0
- libdeflate=1.17=h0b41bf4_0
- libedit=3.1.20191231=he28a2e2_2
- libev=4.33=h516909a_1
- libevent=2.1.10=h28343ad_4
- libffi=3.4.2=h7f98852_5
- libgcc-ng=12.2.0=h65d4601_19
- libgfortran-ng=12.2.0=h69a702a_19
- libgfortran5=12.2.0=h337968e_19
- libgoogle-cloud=2.7.0=h21dfe5b_1
- libgrpc=1.51.1=h4fad500_1
- libhwloc=2.8.0=h32351e8_1
- libiconv=1.17=h166bdaf_0
- liblapack=3.9.0=16_linux64_openblas
- libnghttp2=1.51.0=hff17c54_0
- libnsl=2.0.0=h7f98852_0
- libopenblas=0.3.21=pthreads_h78a6416_3
- libpng=1.6.39=h753d276_0
- libprotobuf=3.21.12=h3eb15da_0
- libsodium=1.0.18=h36c2ea0_1
- libsqlite=3.40.0=h753d276_0
- libssh2=1.10.0=hf14f497_3
- libstdcxx-ng=12.2.0=h46fd767_19
- libthrift=0.16.0=he500d00_2
- libtiff=4.5.0=h6adf6a1_2
- libutf8proc=2.8.0=h166bdaf_0
- libuuid=2.32.1=h7f98852_1000
- libwebp-base=1.2.4=h166bdaf_0
- libxcb=1.13=h7f98852_1004
- libxml2=2.10.3=h7463322_0
- libzlib=1.2.13=h166bdaf_4
- llvm-openmp=15.0.7=h0cdce71_0
- lz4-c=1.9.4=hcb278e6_0
- magma=2.6.2=hc72dce7_0
- markdown=3.4.1=pyhd8ed1ab_0
- markupsafe=2.1.2=py311h2582759_0
- matplotlib-inline=0.1.6=pyhd8ed1ab_0
- mistune=2.0.5=pyhd8ed1ab_0
- mkl=2022.2.1=h84fe81f_16997
- multidict=6.0.4=py311h2582759_0
- multiprocess=0.70.14=py311hd4cff14_3
- nbclassic=0.5.1=pyhd8ed1ab_0
- nbclient=0.7.2=pyhd8ed1ab_0
- nbconvert-core=7.2.9=pyhd8ed1ab_0
- nbconvert-pandoc=7.2.9=pyhd8ed1ab_0
- nbconvert=7.2.9=pyhd8ed1ab_0
- nbformat=5.7.3=pyhd8ed1ab_0
- nccl=2.14.3.1=h0800d71_0
- ncurses=6.3=h27087fc_1
- nest-asyncio=1.5.6=pyhd8ed1ab_0
- ninja=1.11.0=h924138e_0
- notebook-shim=0.2.2=pyhd8ed1ab_0
- notebook=6.5.2=pyha770c72_1
- numpy=1.24.2=py311h8e6699e_0
- openjpeg=2.5.0=hfec8fc6_2
- openssl=3.0.8=h0b41bf4_0
- orc=1.8.2=hfdbbad2_2
- packaging=23.0=pyhd8ed1ab_0
- pandas=1.5.3=py311h2872171_0
- pandoc=2.19.2=h32600fe_1
- pandocfilters=1.5.0=pyhd8ed1ab_0
- panel=0.14.3=py_0
- param=1.12.3=py_0
- parquet-cpp=1.5.1=2
- parso=0.8.3=pyhd8ed1ab_0
- pexpect=4.8.0=pyh1a96a4e_2
- pickleshare=0.7.5=py_1003
- pillow=9.4.0=py311h50def17_1
- pip=23.0=pyhd8ed1ab_0
- pkgutil-resolve-name=1.3.10=pyhd8ed1ab_0
- platformdirs=3.0.0=pyhd8ed1ab_0
- prometheus_client=0.16.0=pyhd8ed1ab_0
- prompt-toolkit=3.0.36=pyha770c72_0
- psutil=5.9.4=py311hd4cff14_0
- pthread-stubs=0.4=h36c2ea0_1001
- ptyprocess=0.7.0=pyhd3deb0d_0
- pure_eval=0.2.2=pyhd8ed1ab_0
- pyarrow=11.0.0=py311hbdf6286_2_cpu
- pycparser=2.21=pyhd8ed1ab_0
- pyct-core=0.5.0=py_0
- pyct=0.5.0=py_0
- pygments=2.14.0=pyhd8ed1ab_0
- pyopenssl=23.0.0=pyhd8ed1ab_0
- pyrsistent=0.19.3=py311h2582759_0
- pysocks=1.7.1=pyha2e5f31_6
- python-dateutil=2.8.2=pyhd8ed1ab_0
- python-fastjsonschema=2.16.2=pyhd8ed1ab_0
- python-json-logger=2.0.4=pyhd8ed1ab_0
- python-xxhash=3.2.0=py311h2582759_0
- python=3.11.0=he550d4f_1_cpython
- python_abi=3.11=3_cp311
- pytorch=1.13.1=cuda112py311h13fee9e_200
- pytz=2022.7.1=pyhd8ed1ab_0
- pyviz_comms=2.2.1=py_0
- pyyaml=6.0=py311hd4cff14_5
- pyzmq=25.0.0=py311hd6ccaeb_0
- re2=2023.02.01=hcb278e6_0
- readline=8.1.2=h0f457ee_0
- regex=2022.10.31=py311hd4cff14_0
- requests=2.28.2=pyhd8ed1ab_0
- responses=0.18.0=pyhd8ed1ab_0
- rfc3339-validator=0.1.4=pyhd8ed1ab_0
- rfc3986-validator=0.1.1=pyh9f0ad1d_0
- s2n=1.3.35=h3358134_0
- sacremoses=0.0.53=pyhd8ed1ab_0
- send2trash=1.8.0=pyhd8ed1ab_0
- setuptools=67.1.0=pyhd8ed1ab_0
- six=1.16.0=pyh6c4a22f_0
- sleef=3.5.1=h9b69904_2
- snappy=1.1.9=hbd366e4_2
- sniffio=1.3.0=pyhd8ed1ab_0
- soupsieve=2.3.2.post1=pyhd8ed1ab_0
- stack_data=0.6.2=pyhd8ed1ab_0
- tbb=2021.7.0=h924138e_1
- terminado=0.17.1=pyh41d4057_0
- tinycss2=1.2.1=pyhd8ed1ab_0
- tk=8.6.12=h27826a3_0
- tokenizers=0.13.2=py311h1b04a43_0
- tornado=6.2=py311hd4cff14_1
- tqdm=4.64.1=pyhd8ed1ab_0
- traitlets=5.9.0=pyhd8ed1ab_0
- transformers=4.26.0=pyhd8ed1ab_0
- typing-extensions=4.4.0=hd8ed1ab_0
- typing_extensions=4.4.0=pyha770c72_0
- tzdata=2022g=h191b570_0
- ucx=1.12.1=h7a399c7_1
- urllib3=1.26.14=pyhd8ed1ab_0
- wcwidth=0.2.6=pyhd8ed1ab_0
- webencodings=0.5.1=py_1
- websocket-client=1.5.1=pyhd8ed1ab_0
- wheel=0.38.4=pyhd8ed1ab_0
- xorg-libxau=1.0.9=h7f98852_0
- xorg-libxdmcp=1.1.3=h7f98852_0
- xxhash=0.8.1=h0b41bf4_0
- xz=5.2.6=h166bdaf_0
- yaml=0.2.5=h7f98852_2
- yarl=1.8.2=py311hd4cff14_0
- zeromq=4.3.4=h9c3ff4c_1
- zipp=3.12.1=pyhd8ed1ab_0
- zlib=1.2.13=h166bdaf_4
- zstd=1.5.2=h3eb15da_6
80 changes: 80 additions & 0 deletions stable_diffusion/anaconda-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# To reproduce: install 'anaconda-project', then 'anaconda-project run'

# required: name MUST match the directory name.
# name must be of the form r'[a-z_]+'
name: stable_diffusion
# required: short project description, used in the main gallery
description: An example panel app for stable diffusion

# required: config
examples_config:
#### REQUIRED ###
# Creation date following the YYYY-MM-DD format
created: 2022-01-30
# List of the GITHUB handle of the authors/maintainers
maintainers:
- "sandhujasmine"
# List of labels displayed in the project card
# Each label must be a name (e.g. panel) that
# refers to a SVG badge located in doc/_static/labels
# (e.g. doc/_static/labels/panel.svg)
labels:
- "panel"

# to build the website (e.g. too long or require too much data).
# This indicates the system not to run them.
skip_notebooks_evaluation: false
# For projects that get their data either by:
# - automatically generating it
# - providing indications
no_data_ingestion: false

# required: (needed internally)
user_fields: [examples_config]

# required: list of the channels needed to solve the environment
channels:
- pyviz
- conda-forge
# To remove the default channel, if need be.
# - nodefaults

# required: list of the direct dependencies needed to run the project.
# Good practice is to pin their minimum version (>=) to indicate the
# version with which the project has been created. Updates to the project
# should updates these pins, if relevant.
packages: &pkgs
# required: must be installed
- notebook >=6.5.2
# following min versions work well together from conda-forge & pyviz
- python >=3.11
- panel >=0.14.2
- diffusers >=0.11.1
- transformers >=4.24.0
- pytorch >=1.13.0
- ftfy >=5.8.0

dependencies: *pkgs

# required: define the commands the project user may run (e.g. anaconda-project run notebook)
commands:
# if you intend to run notebooks, set the `notebook` command
notebook:
# reference a single notebook in your project
notebook: stable_diffusion.ipynb
# shortcut to open all the notebook
# notebook: .
# if you intend to deploy a panel/lumen app, set the `dashboard` command
dashboard:
# the `--rest-session-info --session-history -1` options are required
unix: panel serve --rest-session-info --session-history -1 stable_diffusion.ipynb
supports_http_options: true
# required: a project must have a test command that references the 'test' env_spec

# optional environment variables
variables: {}

# optional downloads
downloads: {}
platforms:
- linux-64
sandhujasmine marked this conversation as resolved.
Show resolved Hide resolved
Loading