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 1 commit
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
25 changes: 25 additions & 0 deletions stable-diffusion/.projectignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# MOST projects DO NOT NEED this file. Only those which publish a data/ folder
jbednar marked this conversation as resolved.
Show resolved Hide resolved
# or, have special needs, should include it.

# project-local contains your personal configuration choices and state
/anaconda-project-local.yml

# Files autocreated by Python
__pycache__/
*.pyc
*.pyo
*.pyd
envs/

# Notebook stuff
.ipynb_checkpoints/

# Data downloaded for the project
# Projects that rely on data published on the repo MUST NOT ignore the data/ folder
# data/

# Images generated by the project
export/

# Dask worker output
dask-worker-space/
120 changes: 120 additions & 0 deletions stable-diffusion/anaconda-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# 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
jbednar marked this conversation as resolved.
Show resolved Hide resolved
# 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:
- "channel_conda-forge"
jbednar marked this conversation as resolved.
Show resolved Hide resolved
- "panel"

### OPTIONAL ###
# Listed deployments will by default automatically be started.
# Maximum number of deployments is 2.
# Each deployment must declare the command it deploys, options
# include "notebook" or "dashboard".
deployments:
jbednar marked this conversation as resolved.
Show resolved Hide resolved
# Will be deployed at {projname_with_hyphens}-notebook.pyviz.demo.anaconda.com
- command: notebook
# Will be deployed at {projname_with_hyphens}.pyviz.demo.anaconda.com
- command: dashboard
# [optional] Set the AE5 container resource profile.
# Options include: "default", "medium" (default), "large"
resource_profile: medium
# [optional] Automatically start the deployment on AE5 when a PR
# modifying the project is merged. Default is true.
auto_deploy: true

# 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
- defaults
- conda-forge
jbednar marked this conversation as resolved.
Show resolved Hide resolved
# 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
# then list all your dependencies, including Python itself
- python >=3.10,<3.11.0a0
- panel >=0.14.2
- diffusers
- transformers
- pytorch
- ftfy

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
test:
sandhujasmine marked this conversation as resolved.
Show resolved Hide resolved
unix: pytest --nbsmoke-run -k *.ipynb --ignore envs
windows: pytest --nbsmoke-run -k *.ipynb --ignore envs
env_spec: test
# required: a project must have a lint command that references the 'test' env_spec
lint:
jbednar marked this conversation as resolved.
Show resolved Hide resolved
unix: pytest --nbsmoke-lint -k *.ipynb --ignore envs
windows: pytest --nbsmoke-lint -k *.ipynb --ignore envs
env_spec: test

# required
env_specs:
default: {}
test:
packages: &testpkgs
- nbsmoke
- pytest
dependencies: *testpkgs


# optional environment variables
variables: {}

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