Krebzonide
commited on
Commit
·
a211f54
1
Parent(s):
6c08f6c
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import random
|
|
4 |
import os
|
5 |
import gradio as gr
|
6 |
|
|
|
7 |
model_id = int(os.getenv("Model"))
|
8 |
nsfw_filter = int(os.getenv("Safe"))
|
9 |
|
@@ -68,7 +69,7 @@ def set_base_model(base_model_id):
|
|
68 |
variant = "fp16",
|
69 |
vae = vae,
|
70 |
use_safetensors = True,
|
71 |
-
use_auth_token=
|
72 |
)
|
73 |
pipe.to("cuda")
|
74 |
pipe.enable_xformers_memory_efficient_attention()
|
@@ -111,7 +112,7 @@ with gr.Blocks(css=css) as demo:
|
|
111 |
with gr.Row():
|
112 |
pixels = gr.Number(label="Pixel Ratio", value=1, interactive=False)
|
113 |
seed = gr.Number(label="Seed", value=-1, minimum=-1, precision=0)
|
114 |
-
gallery = gr.Gallery(
|
115 |
with gr.Row():
|
116 |
lastSeed = gr.Number(label="Last Seed", value=-1, interactive=False)
|
117 |
ex = gr.Examples(examples=examples, inputs=[prompt, negative_prompt])
|
|
|
4 |
import os
|
5 |
import gradio as gr
|
6 |
|
7 |
+
hf_token = os.getenv("HF_TOKEN")
|
8 |
model_id = int(os.getenv("Model"))
|
9 |
nsfw_filter = int(os.getenv("Safe"))
|
10 |
|
|
|
69 |
variant = "fp16",
|
70 |
vae = vae,
|
71 |
use_safetensors = True,
|
72 |
+
use_auth_token=hf_token
|
73 |
)
|
74 |
pipe.to("cuda")
|
75 |
pipe.enable_xformers_memory_efficient_attention()
|
|
|
112 |
with gr.Row():
|
113 |
pixels = gr.Number(label="Pixel Ratio", value=1, interactive=False)
|
114 |
seed = gr.Number(label="Seed", value=-1, minimum=-1, precision=0)
|
115 |
+
gallery = gr.Gallery(show_label=False, elem_id="gallery", allow_preview=False, container=False)
|
116 |
with gr.Row():
|
117 |
lastSeed = gr.Number(label="Last Seed", value=-1, interactive=False)
|
118 |
ex = gr.Examples(examples=examples, inputs=[prompt, negative_prompt])
|