Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,21 +42,21 @@ def genie (prompt, negative_prompt, height, width, scale, steps, seed, upscaling
|
|
| 42 |
image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, num_inference_steps=n_steps, denoising_start=high_noise_frac).images[0] #num_inference_steps=n_steps,
|
| 43 |
upscaled = upscaler(prompt=prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=15, guidance_scale=0).images[0]
|
| 44 |
torch.cuda.empty_cache()
|
| 45 |
-
return
|
| 46 |
else:
|
| 47 |
image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, num_inference_steps=n_steps ,denoising_start=high_noise_frac).images[0]
|
| 48 |
torch.cuda.empty_cache()
|
| 49 |
-
return
|
| 50 |
else:
|
| 51 |
if upscaling == 'Yes':
|
| 52 |
image = pipe(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, num_inference_steps=n_steps, denoising_start=high_noise_frac).images[0] #num_inference_steps=n_steps,
|
| 53 |
upscaled = upscaler(prompt=prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=15, guidance_scale=0).images[0]
|
| 54 |
torch.cuda.empty_cache()
|
| 55 |
-
return
|
| 56 |
else:
|
| 57 |
image = pipe(prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, num_inference_steps=steps, height=height, width=width, guidance_scale=scale, num_images_per_prompt=1, generator=generator).images[0]
|
| 58 |
torch.cuda.empty_cache()
|
| 59 |
-
return
|
| 60 |
|
| 61 |
gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generate. 77 Token Limit. A Token is Any Word, Number, Symbol, or Punctuation. Everything Over 77 Will Be Truncated!'),
|
| 62 |
gr.Textbox(label='What you Do Not want the AI to generate. 77 Token Limit'),
|
|
@@ -71,7 +71,7 @@ gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generat
|
|
| 71 |
gr.Radio(["Yes", "No"], label='SDXL 1.0 Refiner: Use if the Image has too much Noise', value='No'),
|
| 72 |
gr.Slider(minimum=.7, maximum=.99, value=.95, step=.01, label='Refiner Denoise Start %'),
|
| 73 |
gr.Slider(minimum=1, maximum=100, value=100, step=1, label='Refiner Number of Iterations %')],
|
| 74 |
-
outputs=
|
| 75 |
title="Stable Diffusion XL 1.0 GPU",
|
| 76 |
description="SDXL 1.0 GPU. <br><br><b>WARNING: Capable of producing NSFW (Softcore) images.</b>",
|
| 77 |
article = "If You Enjoyed this Demo and would like to Donate, you can send to any of these Wallets. <br>BTC: bc1qzdm9j73mj8ucwwtsjx4x4ylyfvr6kp7svzjn84 <br>BTC2: 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)
|
|
|
|
| 42 |
image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, num_inference_steps=n_steps, denoising_start=high_noise_frac).images[0] #num_inference_steps=n_steps,
|
| 43 |
upscaled = upscaler(prompt=prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=15, guidance_scale=0).images[0]
|
| 44 |
torch.cuda.empty_cache()
|
| 45 |
+
return upscaled
|
| 46 |
else:
|
| 47 |
image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, num_inference_steps=n_steps ,denoising_start=high_noise_frac).images[0]
|
| 48 |
torch.cuda.empty_cache()
|
| 49 |
+
return image
|
| 50 |
else:
|
| 51 |
if upscaling == 'Yes':
|
| 52 |
image = pipe(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, num_inference_steps=n_steps, denoising_start=high_noise_frac).images[0] #num_inference_steps=n_steps,
|
| 53 |
upscaled = upscaler(prompt=prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=15, guidance_scale=0).images[0]
|
| 54 |
torch.cuda.empty_cache()
|
| 55 |
+
return upscaled
|
| 56 |
else:
|
| 57 |
image = pipe(prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, num_inference_steps=steps, height=height, width=width, guidance_scale=scale, num_images_per_prompt=1, generator=generator).images[0]
|
| 58 |
torch.cuda.empty_cache()
|
| 59 |
+
return image
|
| 60 |
|
| 61 |
gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generate. 77 Token Limit. A Token is Any Word, Number, Symbol, or Punctuation. Everything Over 77 Will Be Truncated!'),
|
| 62 |
gr.Textbox(label='What you Do Not want the AI to generate. 77 Token Limit'),
|
|
|
|
| 71 |
gr.Radio(["Yes", "No"], label='SDXL 1.0 Refiner: Use if the Image has too much Noise', value='No'),
|
| 72 |
gr.Slider(minimum=.7, maximum=.99, value=.95, step=.01, label='Refiner Denoise Start %'),
|
| 73 |
gr.Slider(minimum=1, maximum=100, value=100, step=1, label='Refiner Number of Iterations %')],
|
| 74 |
+
outputs='image',
|
| 75 |
title="Stable Diffusion XL 1.0 GPU",
|
| 76 |
description="SDXL 1.0 GPU. <br><br><b>WARNING: Capable of producing NSFW (Softcore) images.</b>",
|
| 77 |
article = "If You Enjoyed this Demo and would like to Donate, you can send to any of these Wallets. <br>BTC: bc1qzdm9j73mj8ucwwtsjx4x4ylyfvr6kp7svzjn84 <br>BTC2: 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)
|