Spaces:
Running
on
Zero
Running
on
Zero
alfredplpl
commited on
Commit
•
999c041
1
Parent(s):
056fb20
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ pipe_normal.load_textual_inversion(state_dict["clip_l"], token="unaestheticXLv31
|
|
23 |
|
24 |
pipe_normal.to("cuda")
|
25 |
|
26 |
-
pipe_normal.enable_freeu(s1=0.9, s2=0.2, b1=1.3, b2=1.4)
|
27 |
|
28 |
compel = Compel(tokenizer=[pipe_normal.tokenizer, pipe_normal.tokenizer_2] ,
|
29 |
text_encoder=[pipe_normal.text_encoder, pipe_normal.text_encoder_2],
|
@@ -33,7 +33,7 @@ compel = Compel(tokenizer=[pipe_normal.tokenizer, pipe_normal.tokenizer_2] ,
|
|
33 |
@spaces.GPU
|
34 |
def run_normal(prompt, negative_prompt="", guidance_scale=7.5, progress=gr.Progress(track_tqdm=True)):
|
35 |
conditioning, pooled = compel(prompt)
|
36 |
-
negative_conditioning, negatice_pooled = compel("unaestheticXLv31
|
37 |
result = pipe_normal(
|
38 |
prompt_embeds=conditioning,
|
39 |
pooled_prompt_embeds=pooled,
|
@@ -56,8 +56,8 @@ margin: 0 auto;
|
|
56 |
normal_examples = [
|
57 |
"1girl, (upper body)++, brown bob short hair, brown eyes, looking at viewer, cherry blossom",
|
58 |
"1girl, (full body)++, brown bob short hair, brown eyes, school uniform, cherry blossom",
|
59 |
-
"no person, manga, Mt. fuji, 4k, highly, detailed",
|
60 |
-
"no person,
|
61 |
"1boy, (upper body)++, black short hair, black eyes, looking at viewer, green leaves",
|
62 |
"1boy, (full body)++, black bob short hair, black eyes, school uniform, green leaves",
|
63 |
]
|
@@ -73,7 +73,7 @@ with gr.Blocks(css=css) as demo:
|
|
73 |
output_normal = gr.Image(label="Your result image", interactive=False)
|
74 |
with gr.Accordion("Advanced Settings", open=False):
|
75 |
negative_prompt_normal = gr.Textbox(label="Negative Prompt")
|
76 |
-
guidance_scale_normal = gr.Number(label="Guidance Scale", value=7)
|
77 |
gr.Examples(examples=normal_examples, fn=run_normal, inputs=[prompt_normal], outputs=[output_normal], cache_examples=True)
|
78 |
|
79 |
gr.on(
|
|
|
23 |
|
24 |
pipe_normal.to("cuda")
|
25 |
|
26 |
+
#pipe_normal.enable_freeu(s1=0.9, s2=0.2, b1=1.3, b2=1.4)
|
27 |
|
28 |
compel = Compel(tokenizer=[pipe_normal.tokenizer, pipe_normal.tokenizer_2] ,
|
29 |
text_encoder=[pipe_normal.text_encoder, pipe_normal.text_encoder_2],
|
|
|
33 |
@spaces.GPU
|
34 |
def run_normal(prompt, negative_prompt="", guidance_scale=7.5, progress=gr.Progress(track_tqdm=True)):
|
35 |
conditioning, pooled = compel(prompt)
|
36 |
+
negative_conditioning, negatice_pooled = compel("unaestheticXLv31-, bad hand, bad anatomy, low quality, "+negative_prompt)
|
37 |
result = pipe_normal(
|
38 |
prompt_embeds=conditioning,
|
39 |
pooled_prompt_embeds=pooled,
|
|
|
56 |
normal_examples = [
|
57 |
"1girl, (upper body)++, brown bob short hair, brown eyes, looking at viewer, cherry blossom",
|
58 |
"1girl, (full body)++, brown bob short hair, brown eyes, school uniform, cherry blossom",
|
59 |
+
"no person, manga, black and white, monochrome, Mt. fuji, 4k, highly, detailed",
|
60 |
+
"no person, manga, black and white, monochrome, buldings in Tokyo from sky, 4k, highly, detailed",
|
61 |
"1boy, (upper body)++, black short hair, black eyes, looking at viewer, green leaves",
|
62 |
"1boy, (full body)++, black bob short hair, black eyes, school uniform, green leaves",
|
63 |
]
|
|
|
73 |
output_normal = gr.Image(label="Your result image", interactive=False)
|
74 |
with gr.Accordion("Advanced Settings", open=False):
|
75 |
negative_prompt_normal = gr.Textbox(label="Negative Prompt")
|
76 |
+
guidance_scale_normal = gr.Number(label="Guidance Scale", value=7.5)
|
77 |
gr.Examples(examples=normal_examples, fn=run_normal, inputs=[prompt_normal], outputs=[output_normal], cache_examples=True)
|
78 |
|
79 |
gr.on(
|