Skip to content

Commit

Permalink
Merge pull request #207 from nateraw/nate-fix-breaking-changes
Browse files Browse the repository at this point in the history
Fix broken colab
  • Loading branch information
nateraw authored May 7, 2024
2 parents bbc32e6 + 55cab18 commit a7c5ad6
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 22 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# stable-diffusion-videos

Try it yourself in Colab: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/nateraw/stable-diffusion-videos/blob/main/stable_diffusion_videos.ipynb)

<!--
TPU version (~x6 faster than standard colab GPUs): [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/nateraw/stable-diffusion-videos/blob/main/flax_stable_diffusion_videos.ipynb)
-->

**Example** - morphing between "blueberry spaghetti" and "strawberry spaghetti"

Expand Down Expand Up @@ -104,9 +105,10 @@ This work built off of [a script](https://gist.github.com/karpathy/00103b0037c5a
You can file any issues/feature requests [here](https://github.com/nateraw/stable-diffusion-videos/issues)

Enjoy 🤗
<!--Commenting this section out for now, as there are issues with RealESRGAN python package-->
<!--
## Extras

### Upsample with Real-ESRGAN
You can also 4x upsample your images with [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN)!
Expand Down Expand Up @@ -138,5 +140,5 @@ from stable_diffusion_videos import RealESRGANModel
model = RealESRGANModel.from_pretrained('nateraw/real-esrgan')
model.upsample_imagefolder('path/to/images/', 'path/to/output_dir')
```

-->

6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
transformers>=4.21.0
diffusers==0.11.1
diffusers
scipy
fire
gradio
librosa
av<10.0.0
realesrgan==0.2.5.0
realesrgan
protobuf==3.20.*
fsspec>=2023.4.0
fsspec>=2023.4.0
11 changes: 6 additions & 5 deletions stable_diffusion_videos.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/nateraw/stable-diffusion-videos/blob/main/stable_diffusion_videos.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/nateraw/stable-diffusion-videos/blob/nate-fix-breaking-changes/stable_diffusion_videos.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
Expand All @@ -24,7 +24,7 @@
"\n",
"If you like this notebook:\n",
"- consider giving the [repo a star](https://github.com/nateraw/stable-diffusion-videos) ⭐️\n",
"- consider following me on Github [@nateraw](https://github.com/nateraw) \n",
"- consider following me on Github [@nateraw](https://github.com/nateraw)\n",
"\n",
"You can file any issues/feature requests [here](https://github.com/nateraw/stable-diffusion-videos/issues)\n",
"\n",
Expand All @@ -49,7 +49,7 @@
"outputs": [],
"source": [
"%%capture\n",
"! pip install stable_diffusion_videos"
"! pip install git+https://github.com/nateraw/stable-diffusion-videos@nate-fix-breaking-changes"
]
},
{
Expand Down Expand Up @@ -82,7 +82,8 @@
"source": [
"import torch\n",
"\n",
"from stable_diffusion_videos import StableDiffusionWalkPipeline, Interface\n",
"from stable_diffusion_videos.app import Interface\n",
"from stable_diffusion_videos.stable_diffusion_pipeline import StableDiffusionWalkPipeline\n",
"\n",
"pipeline = StableDiffusionWalkPipeline.from_pretrained(\n",
" \"CompVis/stable-diffusion-v1-4\",\n",
Expand Down Expand Up @@ -138,7 +139,7 @@
"\n",
"2. Generate videos using the \"Videos\" tab\n",
" - Using the images you found from the step above, provide the prompts/seeds you recorded\n",
" - Set the `num_interpolation_steps` - for testing you can use a small number like 3 or 5, but to get great results you'll want to use something larger (60-200 steps). \n",
" - Set the `num_interpolation_steps` - for testing you can use a small number like 3 or 5, but to get great results you'll want to use something larger (60-200 steps).\n",
"\n",
"💡 **Pro tip** - Click the link that looks like `https://<id-number>.gradio.app` below , and you'll be able to view it in full screen."
]
Expand Down
2 changes: 1 addition & 1 deletion stable_diffusion_videos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ def __dir__():
},
)

__version__ = "0.8.1"
__version__ = "0.9.0"
2 changes: 1 addition & 1 deletion stable_diffusion_videos/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import gradio as gr

from stable_diffusion_videos import generate_images, generate_images_flax
from .image_generation import generate_images, generate_images_flax


class Interface:
Expand Down
2 changes: 1 addition & 1 deletion stable_diffusion_videos/stable_diffusion_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import torch
from diffusers.configuration_utils import FrozenDict
from diffusers.models import AutoencoderKL, UNet2DConditionModel
from diffusers.pipeline_utils import DiffusionPipeline
from diffusers import DiffusionPipeline
from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput
from diffusers.pipelines.stable_diffusion.safety_checker import (
StableDiffusionSafetyChecker,
Expand Down
8 changes: 0 additions & 8 deletions stable_diffusion_videos/upsampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
from torch import nn
from diffusers.utils import logging

try:
from realesrgan import RealESRGANer
from basicsr.archs.rrdbnet_arch import RRDBNet
except ImportError as e:
raise ImportError(
"You tried to import realesrgan without having it installed properly. To install Real-ESRGAN, run:\n\n"
"pip install realesrgan"
)

logger = logging.get_logger(__name__) # pylint: disable=invalid-name

Expand Down

0 comments on commit a7c5ad6

Please sign in to comment.