Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
7bf3d66
1
Parent(s):
f55030b
Update app.py
Browse files
app.py
CHANGED
@@ -12,11 +12,9 @@ from safetensors import safe_open
|
|
12 |
from compel import Compel, ReturnedEmbeddingsType
|
13 |
from safetensors.torch import load_file
|
14 |
|
15 |
-
model_id = '
|
16 |
auth_token=os.environ["ACCESS_TOKEN"]
|
17 |
|
18 |
-
scheduler = EulerAncestralDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler", use_auth_token=auth_token)
|
19 |
-
|
20 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
21 |
model_id,
|
22 |
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
@@ -26,7 +24,7 @@ pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
26 |
pipe=pipe.to("cuda")
|
27 |
#pipe.enable_freeu(s1=0.9, s2=0.2, b1=1.3, b2=1.4)
|
28 |
#pipe.enable_freeu(s1=0.6, s2=0.4, b1=1.1, b2=1.2)
|
29 |
-
|
30 |
|
31 |
state_dict = load_file("unaestheticXLv31.safetensors")
|
32 |
pipe.load_textual_inversion(state_dict["clip_g"], token="unaestheticXLv31", text_encoder=pipe.text_encoder_2, tokenizer=pipe.tokenizer_2)
|
@@ -118,7 +116,7 @@ with gr.Blocks(css=css) as demo:
|
|
118 |
f"""
|
119 |
<div class="main-div">
|
120 |
<div>
|
121 |
-
<h1>
|
122 |
<!--
|
123 |
<h2>
|
124 |
Other Demos:
|
@@ -130,7 +128,7 @@ with gr.Blocks(css=css) as demo:
|
|
130 |
-->
|
131 |
</div>
|
132 |
<p>
|
133 |
-
|
134 |
</p>
|
135 |
<p>
|
136 |
サンプル: そのままGenerateボタンを押してください。<br>
|
@@ -143,14 +141,8 @@ with gr.Blocks(css=css) as demo:
|
|
143 |
sample prompt2 : 1man+, focus, wavy short hair, blue eyes, black shirt, white background, simple background
|
144 |
</p>
|
145 |
<p>
|
146 |
-
sample prompt3 : anime style, 1girl++
|
147 |
-
</p>
|
148 |
-
<p>
|
149 |
-
共有ボタンを押してみんなに画像を共有しましょう。Please push share button to share your image.
|
150 |
-
</p>
|
151 |
-
<p>
|
152 |
-
Running on {"<b>GPU 🔥</b>" if torch.cuda.is_available() else f"<b>CPU 🥶</b>. For faster inference it is recommended to <b>upgrade to GPU in <a href='https://huggingface.co/spaces/akhaliq/cool-japan-diffusion-2-1-0/settings'>Settings</a></b>"} <br>
|
153 |
<a style="display:inline-block" href="https://huggingface.co/spaces/aipicasso/emi-latest-demo?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a> to say goodbye from waiting for the generating.
|
|
|
154 |
</div>
|
155 |
"""
|
156 |
)
|
|
|
12 |
from compel import Compel, ReturnedEmbeddingsType
|
13 |
from safetensors.torch import load_file
|
14 |
|
15 |
+
model_id = 'alfredplpl/emi-2-0'
|
16 |
auth_token=os.environ["ACCESS_TOKEN"]
|
17 |
|
|
|
|
|
18 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
19 |
model_id,
|
20 |
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
|
|
24 |
pipe=pipe.to("cuda")
|
25 |
#pipe.enable_freeu(s1=0.9, s2=0.2, b1=1.3, b2=1.4)
|
26 |
#pipe.enable_freeu(s1=0.6, s2=0.4, b1=1.1, b2=1.2)
|
27 |
+
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
28 |
|
29 |
state_dict = load_file("unaestheticXLv31.safetensors")
|
30 |
pipe.load_textual_inversion(state_dict["clip_g"], token="unaestheticXLv31", text_encoder=pipe.text_encoder_2, tokenizer=pipe.tokenizer_2)
|
|
|
116 |
f"""
|
117 |
<div class="main-div">
|
118 |
<div>
|
119 |
+
<h1>DEmi Test</h1>
|
120 |
<!--
|
121 |
<h2>
|
122 |
Other Demos:
|
|
|
128 |
-->
|
129 |
</div>
|
130 |
<p>
|
131 |
+
Test for Distilled Emi<br>
|
132 |
</p>
|
133 |
<p>
|
134 |
サンプル: そのままGenerateボタンを押してください。<br>
|
|
|
141 |
sample prompt2 : 1man+, focus, wavy short hair, blue eyes, black shirt, white background, simple background
|
142 |
</p>
|
143 |
<p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
<a style="display:inline-block" href="https://huggingface.co/spaces/aipicasso/emi-latest-demo?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a> to say goodbye from waiting for the generating.
|
145 |
+
</p>
|
146 |
</div>
|
147 |
"""
|
148 |
)
|