Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import os
|
| 2 |
import requests
|
| 3 |
import torch
|
|
@@ -7,7 +8,6 @@ from PIL import Image
|
|
| 7 |
from RealESRGAN import RealESRGAN
|
| 8 |
import cv2
|
| 9 |
import numpy as np
|
| 10 |
-
import spaces
|
| 11 |
|
| 12 |
# Constants
|
| 13 |
SD15_WEIGHTS = "weights"
|
|
@@ -39,6 +39,13 @@ def download_file(url, folder_path, filename):
|
|
| 39 |
|
| 40 |
# Download necessary models and files
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
# MODEL
|
| 43 |
download_file(
|
| 44 |
"https://huggingface.co/dantea1118/juggernaut_reborn/resolve/main/juggernaut_reborn.safetensors?download=true",
|
|
@@ -216,12 +223,7 @@ def process_image(input_image, prompt, negative_prompt, resolution=2048, num_inf
|
|
| 216 |
|
| 217 |
return result
|
| 218 |
|
| 219 |
-
|
| 220 |
-
def gradio_process_image(input_image, resolution, num_inference_steps, strength, hdr, guidance_scale):
|
| 221 |
-
prompt = "masterpiece, best quality, highres"
|
| 222 |
-
negative_prompt = "low quality, normal quality, ugly, blurry, blur, lowres, bad anatomy, bad hands, cropped, worst quality, verybadimagenegative_v1.3, JuggernautNegative-neg"
|
| 223 |
-
result = process_image(input_image, prompt, negative_prompt, resolution, num_inference_steps, guidance_scale, strength, hdr)
|
| 224 |
-
return result
|
| 225 |
|
| 226 |
# Simple options
|
| 227 |
simple_options = [
|
|
|
|
| 1 |
+
import spaces
|
| 2 |
import os
|
| 3 |
import requests
|
| 4 |
import torch
|
|
|
|
| 8 |
from RealESRGAN import RealESRGAN
|
| 9 |
import cv2
|
| 10 |
import numpy as np
|
|
|
|
| 11 |
|
| 12 |
# Constants
|
| 13 |
SD15_WEIGHTS = "weights"
|
|
|
|
| 39 |
|
| 40 |
# Download necessary models and files
|
| 41 |
|
| 42 |
+
@spaces.GPU
|
| 43 |
+
def gradio_process_image(input_image, resolution, num_inference_steps, strength, hdr, guidance_scale):
|
| 44 |
+
prompt = "masterpiece, best quality, highres"
|
| 45 |
+
negative_prompt = "low quality, normal quality, ugly, blurry, blur, lowres, bad anatomy, bad hands, cropped, worst quality, verybadimagenegative_v1.3, JuggernautNegative-neg"
|
| 46 |
+
result = process_image(input_image, prompt, negative_prompt, resolution, num_inference_steps, guidance_scale, strength, hdr)
|
| 47 |
+
return result
|
| 48 |
+
|
| 49 |
# MODEL
|
| 50 |
download_file(
|
| 51 |
"https://huggingface.co/dantea1118/juggernaut_reborn/resolve/main/juggernaut_reborn.safetensors?download=true",
|
|
|
|
| 223 |
|
| 224 |
return result
|
| 225 |
|
| 226 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
|
| 228 |
# Simple options
|
| 229 |
simple_options = [
|