Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,14 +7,6 @@ import spaces
|
|
7 |
|
8 |
|
9 |
|
10 |
-
def set_seed(seed=5775709):
|
11 |
-
random.seed(seed)
|
12 |
-
np.random.seed(seed)
|
13 |
-
torch.manual_seed(seed)
|
14 |
-
torch.cuda.manual_seed(seed)
|
15 |
-
|
16 |
-
|
17 |
-
set_seed()
|
18 |
|
19 |
if torch.cuda.is_available():
|
20 |
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, variant="fp16")
|
@@ -47,7 +39,7 @@ with gr.Blocks() as demo:
|
|
47 |
with gr.Row():
|
48 |
prompt_input = gr.Textbox(label="Enter your prompt", placeholder="Type something...", lines=2)
|
49 |
generate_btn = gr.Button("Generate images")
|
50 |
-
guidance_scale = gr.Slider(label="Guidance Scale", minimum=0, maximum=50, value=
|
51 |
num_images_input = gr.Number(label="Number of images", value=5, minimum=1, maximum=10, step=1)
|
52 |
gallery = gr.Gallery(label="Generated images", elem_id="gallery", columns=5, object_fit="contain")
|
53 |
|
|
|
7 |
|
8 |
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
if torch.cuda.is_available():
|
12 |
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, variant="fp16")
|
|
|
39 |
with gr.Row():
|
40 |
prompt_input = gr.Textbox(label="Enter your prompt", placeholder="Type something...", lines=2)
|
41 |
generate_btn = gr.Button("Generate images")
|
42 |
+
guidance_scale = gr.Slider(label="Guidance Scale", minimum=0, maximum=50, value=7.5, step=0.1)
|
43 |
num_images_input = gr.Number(label="Number of images", value=5, minimum=1, maximum=10, step=1)
|
44 |
gallery = gr.Gallery(label="Generated images", elem_id="gallery", columns=5, object_fit="contain")
|
45 |
|