Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,10 +8,8 @@ import streamlit as st
|
|
8 |
is_colab = utils.is_google_colab()
|
9 |
|
10 |
if False:
|
11 |
-
scheduler = DDIMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear",
|
12 |
-
num_train_timesteps=1000, clip_sample=False, set_alpha_to_one=False)
|
13 |
-
|
14 |
model_id_or_path = "CompVis/stable-diffusion-v1-4"
|
|
|
15 |
pipe = CycleDiffusionPipeline.from_pretrained(model_id_or_path,
|
16 |
use_auth_token=st.secrets["USER_TOKEN"],
|
17 |
scheduler=scheduler)
|
@@ -50,19 +48,19 @@ def replace_nsfw_images(results):
|
|
50 |
return results.images[0]
|
51 |
|
52 |
|
53 |
-
css = """.
|
54 |
"""
|
55 |
with gr.Blocks(css=css) as demo:
|
56 |
gr.HTML(
|
57 |
f"""
|
58 |
-
<div class="
|
59 |
<div>
|
60 |
<h1>CycleDiffusion with Stable Diffusion</h1>
|
61 |
</div>
|
62 |
<p>
|
63 |
Demo for CycleDiffusion with Stable Diffusion, built with Diffusers 🧨 by HuggingFace 🤗.
|
64 |
</p>
|
65 |
-
<p>You can skip the queue in the colab: <a href="https://colab.research.google.com/gist/
|
66 |
Running on <b>{device}</b>{(" in a <b>Google Colab</b>." if is_colab else "")}
|
67 |
</p>
|
68 |
</div>
|
|
|
8 |
is_colab = utils.is_google_colab()
|
9 |
|
10 |
if False:
|
|
|
|
|
|
|
11 |
model_id_or_path = "CompVis/stable-diffusion-v1-4"
|
12 |
+
scheduler = DDIMScheduler.from_config(model_id_or_path, subfolder="scheduler")
|
13 |
pipe = CycleDiffusionPipeline.from_pretrained(model_id_or_path,
|
14 |
use_auth_token=st.secrets["USER_TOKEN"],
|
15 |
scheduler=scheduler)
|
|
|
48 |
return results.images[0]
|
49 |
|
50 |
|
51 |
+
css = """.cycle-diffusion-div div{display:inline-flex;align-items:center;gap:.8rem;font-size:1.75rem}.cycle-diffusion-div div h1{font-weight:900;margin-bottom:7px}.cycle-diffusion-div p{margin-bottom:10px;font-size:94%}.cycle-diffusion-div p a{text-decoration:underline}.tabs{margin-top:0;margin-bottom:0}#gallery{min-height:20rem}
|
52 |
"""
|
53 |
with gr.Blocks(css=css) as demo:
|
54 |
gr.HTML(
|
55 |
f"""
|
56 |
+
<div class="cycle-diffusion-div">
|
57 |
<div>
|
58 |
<h1>CycleDiffusion with Stable Diffusion</h1>
|
59 |
</div>
|
60 |
<p>
|
61 |
Demo for CycleDiffusion with Stable Diffusion, built with Diffusers 🧨 by HuggingFace 🤗.
|
62 |
</p>
|
63 |
+
<p>You can skip the queue in the colab: <a href="https://colab.research.google.com/gist/ChenWu98/0aa4fe7be80f6b45d3d055df9f14353a/copy-of-fine-tuned-diffusion-gradio.ipynb"><img data-canonical-src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab" src="https://colab.research.google.com/assets/colab-badge.svg"></a></p>
|
64 |
Running on <b>{device}</b>{(" in a <b>Google Colab</b>." if is_colab else "")}
|
65 |
</p>
|
66 |
</div>
|