Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from diffusers import DiffusionPipeline
|
|
5 |
|
6 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
7 |
if torch.cuda.is_available():
|
8 |
-
PYTORCH_CUDA_ALLOC_CONF={'max_split_size_mb': 6000}
|
9 |
torch.cuda.max_memory_allocated(device=device)
|
10 |
torch.cuda.empty_cache()
|
11 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/sdxl-turbo", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
|
@@ -27,7 +27,7 @@ else:
|
|
27 |
|
28 |
def genie (prompt, steps, seed):
|
29 |
generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
|
30 |
-
int_image = pipe(prompt=prompt, generator=generator, num_inference_steps=steps, guidance_scale=0.0).images[0]
|
31 |
#image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, denoising_start=high_noise_frac).images[0]
|
32 |
return int_image
|
33 |
|
@@ -43,6 +43,6 @@ gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generat
|
|
43 |
#gr.Slider(minimum=.7, maximum=.99, value=.95, step=.01, label='Refiner Denoise Start %')
|
44 |
],
|
45 |
outputs='image',
|
46 |
-
title="Stable Diffusion
|
47 |
-
description="SDXL
|
48 |
article = "If You Enjoyed this Demo and would like to Donate, you can send to any of these W7allets. <br>BTC: bc1qzdm9j73mj8ucwwtsjx4x4ylyfvr6kp7svzjn84 <br>3LWRoKYx6bCLnUrKEdnPo3FCSPQUSFDjFP <br>DOGE: DK6LRc4gfefdCTRk9xPD239N31jh9GjKez <br>SHIB (BEP20): 0xbE8f2f3B71DFEB84E5F7E3aae1909d60658aB891 <br>PayPal: https://www.paypal.me/ManjushriBodhisattva <br>ETH: 0xbE8f2f3B71DFEB84E5F7E3aae1909d60658aB891 <br>Code Monkey: <a href=\"https://huggingface.co/Manjushri\">Manjushri</a>").launch(debug=True, max_threads=80)
|
|
|
5 |
|
6 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
7 |
if torch.cuda.is_available():
|
8 |
+
#PYTORCH_CUDA_ALLOC_CONF={'max_split_size_mb': 6000}
|
9 |
torch.cuda.max_memory_allocated(device=device)
|
10 |
torch.cuda.empty_cache()
|
11 |
pipe = DiffusionPipeline.from_pretrained("stabilityai/sdxl-turbo", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
|
|
|
27 |
|
28 |
def genie (prompt, steps, seed):
|
29 |
generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
|
30 |
+
int_image = pipe(prompt=prompt, generator=generator, num_inference_steps=steps, guidance_scale=0.0).images[0] 8
|
31 |
#image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, denoising_start=high_noise_frac).images[0]
|
32 |
return int_image
|
33 |
|
|
|
43 |
#gr.Slider(minimum=.7, maximum=.99, value=.95, step=.01, label='Refiner Denoise Start %')
|
44 |
],
|
45 |
outputs='image',
|
46 |
+
title="Stable Diffusion Turbo CPU or GPU",
|
47 |
+
description="SDXL Turbo CPU or GPU. Currently running on CPU. <br><br><b>WARNING:</b> Extremely Slow. 65s/Iteration. Expect 25-50mins an image for 25-50 iterations respectively. This model is capable of producing NSFW (Softcore) images.",
|
48 |
article = "If You Enjoyed this Demo and would like to Donate, you can send to any of these W7allets. <br>BTC: bc1qzdm9j73mj8ucwwtsjx4x4ylyfvr6kp7svzjn84 <br>3LWRoKYx6bCLnUrKEdnPo3FCSPQUSFDjFP <br>DOGE: DK6LRc4gfefdCTRk9xPD239N31jh9GjKez <br>SHIB (BEP20): 0xbE8f2f3B71DFEB84E5F7E3aae1909d60658aB891 <br>PayPal: https://www.paypal.me/ManjushriBodhisattva <br>ETH: 0xbE8f2f3B71DFEB84E5F7E3aae1909d60658aB891 <br>Code Monkey: <a href=\"https://huggingface.co/Manjushri\">Manjushri</a>").launch(debug=True, max_threads=80)
|