Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from diffusion_lens import get_images
|
|
|
3 |
|
4 |
MAX_SEED = np.iinfo(np.int32).max
|
5 |
|
@@ -38,6 +39,7 @@ model_num_of_layers = {
|
|
38 |
}
|
39 |
|
40 |
def generate_images(prompt, model, seed):
|
|
|
41 |
print('calling diffusion lens with model:', model, 'and seed:', seed)
|
42 |
gr.Info('Generating images from intermediate layers..')
|
43 |
all_images = [] # Initialize a list to store all images
|
|
|
1 |
import gradio as gr
|
2 |
from diffusion_lens import get_images
|
3 |
+
import numpy as np
|
4 |
|
5 |
MAX_SEED = np.iinfo(np.int32).max
|
6 |
|
|
|
39 |
}
|
40 |
|
41 |
def generate_images(prompt, model, seed):
|
42 |
+
seed = random.randint(0, MAX_SEED) if seed == -1 else seed
|
43 |
print('calling diffusion lens with model:', model, 'and seed:', seed)
|
44 |
gr.Info('Generating images from intermediate layers..')
|
45 |
all_images = [] # Initialize a list to store all images
|