Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,3 @@
|
|
| 1 |
-
#!/usr/bin/env python
|
| 2 |
-
#patch 2.0 ()
|
| 3 |
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 4 |
-
# of this software and associated documentation files (the "Software"), to deal
|
| 5 |
-
# in the Software without restriction, including without limitation the rights
|
| 6 |
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 7 |
-
# copies of the Software, and to permit persons to whom the Software is
|
| 8 |
-
# furnished to do so, subject to the following conditions:
|
| 9 |
-
# ...
|
| 10 |
-
import os
|
| 11 |
import random
|
| 12 |
import uuid
|
| 13 |
import json
|
|
@@ -18,11 +8,6 @@ import spaces
|
|
| 18 |
import torch
|
| 19 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
| 20 |
|
| 21 |
-
#Load the HTML content
|
| 22 |
-
#html_file_url = "https://prithivmlmods-hamster-static.static.hf.space/index.html"
|
| 23 |
-
#html_content = f'<iframe src="{html_file_url}" style="width:100%; height:180px; border:none;"></iframe>'
|
| 24 |
-
#html_file_url = "https://prithivmlmods-static-loading-theme.static.hf.space/index.html"
|
| 25 |
-
|
| 26 |
html_file_url = "https://prithivhamster.vercel.app/"
|
| 27 |
html_content = f'<iframe src="{html_file_url}" style="width:100%; height:400px; border:none"></iframe>'
|
| 28 |
|
|
@@ -43,21 +28,7 @@ examples = [
|
|
| 43 |
#"Photorealistic Image of a Lonely Boy and Dog in Sunny Field, Golden Hour Lighting, Soft Focus, High Resolution (4K), 50mm Lens, Close-Up Shot, Natural Lighting.",
|
| 44 |
]
|
| 45 |
|
| 46 |
-
|
| 47 |
-
#examples = [
|
| 48 |
-
# ["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)"],
|
| 49 |
-
# ["file/2.png", "Cold coffee in a cup bokeh --ar 85:128 --v 6.0 --style raw5, 4K"],
|
| 50 |
-
#["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"],
|
| 51 |
-
#["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"],
|
| 52 |
-
#["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"]
|
| 53 |
-
#]
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
#Set an os.Getenv variable
|
| 57 |
-
#set VAR_NAME=”VALUE”
|
| 58 |
-
#Fetch an environment variable
|
| 59 |
#echo %VAR_NAME%
|
| 60 |
-
|
| 61 |
MODEL_ID = os.getenv("MODEL_VAL_PATH") #Use SDXL Model as "MODEL_REPO" --------->>> ”VALUE”.
|
| 62 |
MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "4096"))
|
| 63 |
USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "0") == "1"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import random
|
| 2 |
import uuid
|
| 3 |
import json
|
|
|
|
| 8 |
import torch
|
| 9 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
html_file_url = "https://prithivhamster.vercel.app/"
|
| 12 |
html_content = f'<iframe src="{html_file_url}" style="width:100%; height:400px; border:none"></iframe>'
|
| 13 |
|
|
|
|
| 28 |
#"Photorealistic Image of a Lonely Boy and Dog in Sunny Field, Golden Hour Lighting, Soft Focus, High Resolution (4K), 50mm Lens, Close-Up Shot, Natural Lighting.",
|
| 29 |
]
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
#echo %VAR_NAME%
|
|
|
|
| 32 |
MODEL_ID = os.getenv("MODEL_VAL_PATH") #Use SDXL Model as "MODEL_REPO" --------->>> ”VALUE”.
|
| 33 |
MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "4096"))
|
| 34 |
USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "0") == "1"
|