Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, re
|
|
14 |
generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
|
15 |
|
16 |
if Model == "PhotoReal":
|
17 |
-
pipe = DiffusionPipeline.from_pretrained("circulus/canvers-real-v3.
|
18 |
pipe.enable_xformers_memory_efficient_attention()
|
19 |
pipe = pipe.to(device)
|
20 |
torch.cuda.empty_cache()
|
@@ -52,7 +52,7 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, re
|
|
52 |
return image
|
53 |
|
54 |
if Model == "Anime":
|
55 |
-
anime = DiffusionPipeline.from_pretrained("circulus/canvers-anime-v3.
|
56 |
anime.enable_xformers_memory_efficient_attention()
|
57 |
anime = anime.to(device)
|
58 |
torch.cuda.empty_cache()
|
@@ -90,7 +90,7 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, re
|
|
90 |
return image
|
91 |
|
92 |
if Model == "Disney":
|
93 |
-
disney = DiffusionPipeline.from_pretrained("circulus/canvers-disney-v3.
|
94 |
disney.enable_xformers_memory_efficient_attention()
|
95 |
disney = disney.to(device)
|
96 |
torch.cuda.empty_cache()
|
@@ -129,7 +129,7 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, re
|
|
129 |
return image
|
130 |
|
131 |
if Model == "StoryBook":
|
132 |
-
story = DiffusionPipeline.from_pretrained("circulus/canvers-story-v3.
|
133 |
story.enable_xformers_memory_efficient_attention()
|
134 |
story = story.to(device)
|
135 |
torch.cuda.empty_cache()
|
@@ -170,7 +170,7 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, re
|
|
170 |
return image
|
171 |
|
172 |
if Model == "SemiReal":
|
173 |
-
semi = DiffusionPipeline.from_pretrained("circulus/canvers-semi-v3.
|
174 |
semi.enable_xformers_memory_efficient_attention()
|
175 |
semi = semi.to(device)
|
176 |
torch.cuda.empty_cache()
|
@@ -398,6 +398,6 @@ gr.Interface(fn=genie, inputs=[gr.Radio(['PhotoReal', 'Anime', 'Disney', 'StoryB
|
|
398 |
gr.Slider(minimum=.9, maximum=.99, value=.95, step=.01, label='Refiner Denoise Start %'),
|
399 |
gr.Radio(["Yes", "No"], label = 'SD X2 Latent Upscaler?', value="No")],
|
400 |
outputs=gr.Image(label='Generated Image'),
|
401 |
-
title="Manju Dream Booth V1.
|
402 |
description="<br><br><b/>Warning: This Demo is capable of producing NSFW content.",
|
403 |
article = "If You Enjoyed this Demo and would like to Donate, you can send any amount to any of these Wallets. <br><br>SHIB (BEP20): 0xbE8f2f3B71DFEB84E5F7E3aae1909d60658aB891 <br>PayPal: https://www.paypal.me/ManjushriBodhisattva <br>ETH: 0xbE8f2f3B71DFEB84E5F7E3aae1909d60658aB891 <br>DOGE: D9QdVPtcU1EFH8jDC8jhU9uBcSTqUiA8h6<br><br>Code Monkey: <a href=\"https://huggingface.co/Manjushri\">Manjushri</a>").launch(debug=True, max_threads=80)
|
|
|
14 |
generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
|
15 |
|
16 |
if Model == "PhotoReal":
|
17 |
+
pipe = DiffusionPipeline.from_pretrained("circulus/canvers-real-v3.9.1", torch_dtype=torch.float16, safety_checker=None) if torch.cuda.is_available() else DiffusionPipeline.from_pretrained("circulus/canvers-real-v3.8.1")
|
18 |
pipe.enable_xformers_memory_efficient_attention()
|
19 |
pipe = pipe.to(device)
|
20 |
torch.cuda.empty_cache()
|
|
|
52 |
return image
|
53 |
|
54 |
if Model == "Anime":
|
55 |
+
anime = DiffusionPipeline.from_pretrained("circulus/canvers-anime-v3.9.1", torch_dtype=torch.float16, safety_checker=None) if torch.cuda.is_available() else DiffusionPipeline.from_pretrained("circulus/canvers-anime-v3.8.1")
|
56 |
anime.enable_xformers_memory_efficient_attention()
|
57 |
anime = anime.to(device)
|
58 |
torch.cuda.empty_cache()
|
|
|
90 |
return image
|
91 |
|
92 |
if Model == "Disney":
|
93 |
+
disney = DiffusionPipeline.from_pretrained("circulus/canvers-disney-v3.9.1", torch_dtype=torch.float16, safety_checker=None) if torch.cuda.is_available() else DiffusionPipeline.from_pretrained("circulus/canvers-disney-v3.8.1")
|
94 |
disney.enable_xformers_memory_efficient_attention()
|
95 |
disney = disney.to(device)
|
96 |
torch.cuda.empty_cache()
|
|
|
129 |
return image
|
130 |
|
131 |
if Model == "StoryBook":
|
132 |
+
story = DiffusionPipeline.from_pretrained("circulus/canvers-story-v3.9.1", torch_dtype=torch.float16, safety_checker=None) if torch.cuda.is_available() else DiffusionPipeline.from_pretrained("circulus/canvers-story-v3.8.1")
|
133 |
story.enable_xformers_memory_efficient_attention()
|
134 |
story = story.to(device)
|
135 |
torch.cuda.empty_cache()
|
|
|
170 |
return image
|
171 |
|
172 |
if Model == "SemiReal":
|
173 |
+
semi = DiffusionPipeline.from_pretrained("circulus/canvers-semi-v3.9.1", torch_dtype=torch.float16, safety_checker=None) if torch.cuda.is_available() else DiffusionPipeline.from_pretrained("circulus/canvers-semi-v3.8.1")
|
174 |
semi.enable_xformers_memory_efficient_attention()
|
175 |
semi = semi.to(device)
|
176 |
torch.cuda.empty_cache()
|
|
|
398 |
gr.Slider(minimum=.9, maximum=.99, value=.95, step=.01, label='Refiner Denoise Start %'),
|
399 |
gr.Radio(["Yes", "No"], label = 'SD X2 Latent Upscaler?', value="No")],
|
400 |
outputs=gr.Image(label='Generated Image'),
|
401 |
+
title="Manju Dream Booth V1.9 with SDXL 1.0 Refiner and SD X2 Latent Upscaler - GPU",
|
402 |
description="<br><br><b/>Warning: This Demo is capable of producing NSFW content.",
|
403 |
article = "If You Enjoyed this Demo and would like to Donate, you can send any amount to any of these Wallets. <br><br>SHIB (BEP20): 0xbE8f2f3B71DFEB84E5F7E3aae1909d60658aB891 <br>PayPal: https://www.paypal.me/ManjushriBodhisattva <br>ETH: 0xbE8f2f3B71DFEB84E5F7E3aae1909d60658aB891 <br>DOGE: D9QdVPtcU1EFH8jDC8jhU9uBcSTqUiA8h6<br><br>Code Monkey: <a href=\"https://huggingface.co/Manjushri\">Manjushri</a>").launch(debug=True, max_threads=80)
|