Stable Diffusion model clearing
See original GitHub issueIt would be nice to have a function that unloads modules from memory, otherwise when repeatedly using the StableDiffusion class, RAM overflow occurs
import keras_cv
import matplotlib.pyplot as plt
def plot_images(images):
plt.figure(figsize=(20, 20))
for i in range(len(images)):
plt.subplot(1, len(images), i + 1)
plt.imshow(images[i])
plt.axis("off")
plt.show()
for i in range(2):
model = keras_cv.models.StableDiffusion(img_width=512 // (i + 1), img_height=512 // (i + 1))
images = model.text_to_image("photograph of an astronaut riding a horse", batch_size=2)
plot_images(images)
# Some other stuff
Issue Analytics
- State:
- Created 9 months ago
- Comments:7
Top Results From Across the Web
README.md · stabilityai/stable-diffusion-2-1 at main
This model card focuses on the model associated with the Stable Diffusion v2-1 model, codebase available here. This stable-diffusion-2-1 ...
Read more >How does Stable Diffusion work? - YouTube
StableDiffusion explained. How does an AI generate images from text? How do Latent Diffusion Models work? If you want answers to these ...
Read more >Runway Released a Stable Diffusion-Powered Tool ... - 80 Level
Runway has released an Erase and Replace tool powered by Stable Diffusion that can change parts of images with whatever you tell the...
Read more >Diffusion Models: A Practical Guide - Scale AI
With the Release of Dall-E 2, Google's Imagen, Stable Diffusion, and Midjourney, diffusion models have taken the world by storm, ...
Read more >What are Stable Diffusion Models and Why are they a Step ...
Figure 1: Latent Diffusion Model (Base Diagram:[3], Concept-Map Overlay: Author). In this article you will learn about a recent advancement in Image ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
move the line
out of the loop. You only need to construct the pipeline once.
Yes, I’ve already tried it, it doesn’t help, 2 starts already takes about 8 GB of RAM