Commit
•
899c80f
1
Parent(s):
47f4d74
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import torch
|
|
6 |
from PIL import Image
|
7 |
import random
|
8 |
|
9 |
-
model_id = 'aipicasso/cool-japan-diffusion-2-1-
|
10 |
|
11 |
scheduler = EulerAncestralDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
|
12 |
feature_extractor = CLIPFeatureExtractor.from_pretrained(model_id)
|
@@ -41,14 +41,14 @@ def inference(prompt, guidance, steps, image_size="Square", seed=0, img=None, st
|
|
41 |
prompt,neg_prompt=auto_prompt_correction(prompt,neg_prompt,cool_japan_type,disable_auto_prompt_correction)
|
42 |
|
43 |
if(image_size=="Portrait"):
|
44 |
-
height=
|
45 |
-
width=
|
46 |
elif(image_size=="Landscape"):
|
47 |
-
height=
|
48 |
-
width=
|
49 |
else:
|
50 |
-
height=
|
51 |
-
width=
|
52 |
|
53 |
print(prompt,neg_prompt)
|
54 |
|
@@ -149,13 +149,13 @@ with gr.Blocks(css=css) as demo:
|
|
149 |
f"""
|
150 |
<div class="main-div">
|
151 |
<div>
|
152 |
-
<h1>Cool Japan Diffusion 2.1.
|
153 |
</div>
|
154 |
<p>
|
155 |
-
Demo for <a href="https://huggingface.co/aipicasso/cool-japan-diffusion-2-1-
|
156 |
</p>
|
157 |
<p>
|
158 |
-
sample : Click "Generate" button without any
|
159 |
</p>
|
160 |
<p>
|
161 |
sample prompt1 : girl, kimono
|
@@ -184,7 +184,7 @@ with gr.Blocks(css=css) as demo:
|
|
184 |
prompt = gr.Textbox(label="Prompt", show_label=False, max_lines=2,placeholder="[your prompt]").style(container=False)
|
185 |
generate = gr.Button(value="Generate").style(rounded=(False, True, True, False))
|
186 |
|
187 |
-
image_out = gr.Image(height=768,width=
|
188 |
error_output = gr.Markdown()
|
189 |
|
190 |
with gr.Column(scale=45):
|
@@ -195,7 +195,7 @@ with gr.Blocks(css=css) as demo:
|
|
195 |
with gr.Row():
|
196 |
image_size=gr.Radio(["Portrait","Landscape","Square"])
|
197 |
image_size.show_label=False
|
198 |
-
image_size.value="
|
199 |
|
200 |
with gr.Row():
|
201 |
guidance = gr.Slider(label="Guidance scale", value=7.5, maximum=15)
|
|
|
6 |
from PIL import Image
|
7 |
import random
|
8 |
|
9 |
+
model_id = 'aipicasso/cool-japan-diffusion-2-1-2-beta'
|
10 |
|
11 |
scheduler = EulerAncestralDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
|
12 |
feature_extractor = CLIPFeatureExtractor.from_pretrained(model_id)
|
|
|
41 |
prompt,neg_prompt=auto_prompt_correction(prompt,neg_prompt,cool_japan_type,disable_auto_prompt_correction)
|
42 |
|
43 |
if(image_size=="Portrait"):
|
44 |
+
height=1024
|
45 |
+
width=768
|
46 |
elif(image_size=="Landscape"):
|
47 |
+
height=768
|
48 |
+
width=1024
|
49 |
else:
|
50 |
+
height=768
|
51 |
+
width=768
|
52 |
|
53 |
print(prompt,neg_prompt)
|
54 |
|
|
|
149 |
f"""
|
150 |
<div class="main-div">
|
151 |
<div>
|
152 |
+
<h1>Cool Japan Diffusion 2.1.2 Beta</h1>
|
153 |
</div>
|
154 |
<p>
|
155 |
+
Demo for <a href="https://huggingface.co/aipicasso/cool-japan-diffusion-2-1-2-beta">Cool Japan Diffusion 2.1.2 Beta</a> Stable Diffusion model.<br>
|
156 |
</p>
|
157 |
<p>
|
158 |
+
sample : Click "Generate" button without any prompts.
|
159 |
</p>
|
160 |
<p>
|
161 |
sample prompt1 : girl, kimono
|
|
|
184 |
prompt = gr.Textbox(label="Prompt", show_label=False, max_lines=2,placeholder="[your prompt]").style(container=False)
|
185 |
generate = gr.Button(value="Generate").style(rounded=(False, True, True, False))
|
186 |
|
187 |
+
image_out = gr.Image(height=768,width=768)
|
188 |
error_output = gr.Markdown()
|
189 |
|
190 |
with gr.Column(scale=45):
|
|
|
195 |
with gr.Row():
|
196 |
image_size=gr.Radio(["Portrait","Landscape","Square"])
|
197 |
image_size.show_label=False
|
198 |
+
image_size.value="Square"
|
199 |
|
200 |
with gr.Row():
|
201 |
guidance = gr.Slider(label="Guidance scale", value=7.5, maximum=15)
|