Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ resolutions = ["1024 1024","1280 768","1344 768","768 1344","768 1280"]
|
|
15 |
default_negative_prompt= "Logo,Watermark,Text,Ugly,Morbid,Extra fingers,Poorly drawn hands,Mutation,Blurry,Extra limbs,Gross proportions,Missing arms,Mutated hands,Long neck,Duplicate,Mutilated,Mutilated hands,Poorly drawn face,Deformed,Bad anatomy,Cloned face,Malformed limbs,Missing legs,Too many fingers"
|
16 |
|
17 |
# Load pipeline
|
18 |
-
model_id = "briaai/BRIA-2.
|
19 |
scheduler = EulerAncestralDiscreteScheduler(
|
20 |
beta_start=0.00085,
|
21 |
beta_end=0.012,
|
@@ -26,7 +26,7 @@ scheduler = EulerAncestralDiscreteScheduler(
|
|
26 |
pipe = StableDiffusionXLPipeline.from_pretrained(model_id, torch_dtype=torch.float16,scheduler=scheduler).to("cuda")
|
27 |
pipe.force_zeros_for_empty_prompt = False
|
28 |
|
29 |
-
print("Optimizing BRIA-2.
|
30 |
t=time.time()
|
31 |
pipe.unet = torch.compile(
|
32 |
pipe.unet, mode="reduce-overhead", fullgraph=True # 600 secs compilation
|
@@ -86,12 +86,12 @@ css = """
|
|
86 |
"""
|
87 |
with gr.Blocks(css=css) as demo:
|
88 |
with gr.Column(elem_id="col-container"):
|
89 |
-
gr.Markdown("## BRIA 2.
|
90 |
gr.HTML('''
|
91 |
<p style="margin-bottom: 10px; font-size: 94%">
|
92 |
This is a demo for
|
93 |
-
<a href="https://huggingface.co/briaai/BRIA-2.
|
94 |
-
BRIA 2.
|
95 |
</p>
|
96 |
''')
|
97 |
with gr.Group():
|
@@ -101,7 +101,7 @@ with gr.Blocks(css=css) as demo:
|
|
101 |
seed = gr.Textbox(label="Seed", value=-1)
|
102 |
negative_prompt = gr.Textbox(label="Negative Prompt", value=default_negative_prompt)
|
103 |
submit_btn = gr.Button("Generate")
|
104 |
-
result = gr.Image(label="BRIA-2.
|
105 |
|
106 |
# gr.Examples(
|
107 |
# examples = [
|
|
|
15 |
default_negative_prompt= "Logo,Watermark,Text,Ugly,Morbid,Extra fingers,Poorly drawn hands,Mutation,Blurry,Extra limbs,Gross proportions,Missing arms,Mutated hands,Long neck,Duplicate,Mutilated,Mutilated hands,Poorly drawn face,Deformed,Bad anatomy,Cloned face,Malformed limbs,Missing legs,Too many fingers"
|
16 |
|
17 |
# Load pipeline
|
18 |
+
model_id = "briaai/BRIA-2.3-BETA"
|
19 |
scheduler = EulerAncestralDiscreteScheduler(
|
20 |
beta_start=0.00085,
|
21 |
beta_end=0.012,
|
|
|
26 |
pipe = StableDiffusionXLPipeline.from_pretrained(model_id, torch_dtype=torch.float16,scheduler=scheduler).to("cuda")
|
27 |
pipe.force_zeros_for_empty_prompt = False
|
28 |
|
29 |
+
print("Optimizing BRIA-2.3 - this could take a while")
|
30 |
t=time.time()
|
31 |
pipe.unet = torch.compile(
|
32 |
pipe.unet, mode="reduce-overhead", fullgraph=True # 600 secs compilation
|
|
|
86 |
"""
|
87 |
with gr.Blocks(css=css) as demo:
|
88 |
with gr.Column(elem_id="col-container"):
|
89 |
+
gr.Markdown("## BRIA 2.3 Beta")
|
90 |
gr.HTML('''
|
91 |
<p style="margin-bottom: 10px; font-size: 94%">
|
92 |
This is a demo for
|
93 |
+
<a href="https://huggingface.co/briaai/BRIA-2.3-BETA" target="_blank">BRIA 2.3 text-to-image </a>.
|
94 |
+
BRIA 2.3 BETA improve the generation of humans and illustrations compared to BRIA 2.2 while still trained on licensed data, and so provide full legal liability coverage for copyright and privacy infringement.
|
95 |
</p>
|
96 |
''')
|
97 |
with gr.Group():
|
|
|
101 |
seed = gr.Textbox(label="Seed", value=-1)
|
102 |
negative_prompt = gr.Textbox(label="Negative Prompt", value=default_negative_prompt)
|
103 |
submit_btn = gr.Button("Generate")
|
104 |
+
result = gr.Image(label="BRIA-2.3 Result")
|
105 |
|
106 |
# gr.Examples(
|
107 |
# examples = [
|