Spaces:
Running
Running
Delete extensions
Browse files
extensions/__pycache__/anycreator.cpython-311.pyc
DELETED
|
Binary file (1.78 kB)
|
|
|
extensions/__pycache__/code_interpreter.cpython-311.pyc
DELETED
|
Binary file (8.59 kB)
|
|
|
extensions/__pycache__/codebot.cpython-311.pyc
DELETED
|
Binary file (25.2 kB)
|
|
|
extensions/__pycache__/extensions.cpython-311.pyc
DELETED
|
Binary file (6.97 kB)
|
|
|
extensions/anycreator.py
DELETED
|
@@ -1,31 +0,0 @@
|
|
| 1 |
-
import random
|
| 2 |
-
import urllib.request
|
| 3 |
-
import requests
|
| 4 |
-
import time
|
| 5 |
-
import urllib.request
|
| 6 |
-
data={}
|
| 7 |
-
imgur=[]
|
| 8 |
-
def getimage(query):
|
| 9 |
-
|
| 10 |
-
payload = {
|
| 11 |
-
"model": "absolutereality_v181.safetensors [3d9d4d2b]",
|
| 12 |
-
"prompt": str(query)
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
response = requests.post("https://api.prodia.com/v1/sd/generate", json=payload, headers={"accept": "application/json","content-type": "application/json","X-Prodia-Key": "da6053eb-c352-4374-a459-2a9a5eaaa64b"})
|
| 16 |
-
jobid=response.json()["job"]
|
| 17 |
-
while True:
|
| 18 |
-
response = requests.get(f"https://api.prodia.com/v1/job/{jobid}", headers={"accept": "application/json","X-Prodia-Key": "da6053eb-c352-4374-a459-2a9a5eaaa64b"})
|
| 19 |
-
if response.json()["status"]=="succeeded":
|
| 20 |
-
image=response.json()["imageUrl"]
|
| 21 |
-
break
|
| 22 |
-
time.sleep(0.5)
|
| 23 |
-
|
| 24 |
-
filename=f"static/image{random.randint(1,1000)}.png"
|
| 25 |
-
|
| 26 |
-
urllib.request.urlretrieve(image, filename)
|
| 27 |
-
|
| 28 |
-
return filename
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|