Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
# ...
|
2 |
import os
|
3 |
import random
|
4 |
import uuid
|
@@ -26,26 +25,11 @@ examples = [
|
|
26 |
"Cold coffee in a cup bokeh --ar 85:128 --v 6.0 --style raw5, 4K",
|
27 |
]
|
28 |
|
29 |
-
|
30 |
-
#examples = [
|
31 |
-
# ["file/1.png", "3d image, cute girl, in the style of Pixar --ar 1:2 --stylize 750, 4K resolution highlights, Sharp focus, octane render, ray tracing, Ultra-High-Definition, 8k, UHD, HDR, (Masterpiece:1.5), (best quality:1.5)"],
|
32 |
-
# ["file/2.png", "Cold coffee in a cup bokeh --ar 85:128 --v 6.0 --style raw5, 4K"],
|
33 |
-
#["file/3.png", "Vector illustration of a horse, vector graphic design with flat colors on a brown background in the style of vector art, using simple shapes and graphics with simple details, professionally designed as a tshirt logo ready for print on a white background. --ar 89:82 --v 6.0 --style raw"],
|
34 |
-
#["file/4.png", "Man in brown leather jacket posing for the camera, in the style of sleek and stylized, clockpunk, subtle shades, exacting precision, ferrania p30 --ar 67:101 --v 5"],
|
35 |
-
#["file/5.png", "Commercial photography, giant burger, white lighting, studio light, 8k octane rendering, high resolution photography, insanely detailed, fine details, on a white isolated plain, 8k, commercial photography, stock photo, professional color grading, --v 4 --ar 9:16"]
|
36 |
-
#]
|
37 |
-
|
38 |
-
|
39 |
-
#Set an os.Getenv variable
|
40 |
-
#set VAR_NAME=”VALUE”
|
41 |
-
#Fetch an environment variable
|
42 |
-
#echo %VAR_NAME%
|
43 |
-
|
44 |
-
MODEL_ID = os.getenv("MODEL_VAL_PATH") #Use SDXL Model as "MODEL_REPO" --------->>> ”VALUE”.
|
45 |
MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "4096"))
|
46 |
USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "0") == "1"
|
47 |
ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"
|
48 |
-
BATCH_SIZE = int(os.getenv("BATCH_SIZE", "1"))
|
49 |
|
50 |
#Load model outside of function
|
51 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
|
|
|
1 |
import os
|
2 |
import random
|
3 |
import uuid
|
|
|
25 |
"Cold coffee in a cup bokeh --ar 85:128 --v 6.0 --style raw5, 4K",
|
26 |
]
|
27 |
|
28 |
+
MODEL_ID = os.getenv("MODEL_VAL_PATH", "SG161222/RealVisXL_V4.0_Lightning")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "4096"))
|
30 |
USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "0") == "1"
|
31 |
ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"
|
32 |
+
BATCH_SIZE = int(os.getenv("BATCH_SIZE", "1"))
|
33 |
|
34 |
#Load model outside of function
|
35 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|