forked from AUTOMATIC1111/stable-diffusion-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathray.py
More file actions
25 lines (20 loc) · 874 Bytes
/
Copy pathray.py
File metadata and controls
25 lines (20 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from ray import serve
import ray
from modules.api.raypi import Raypi
import time
import os
#ray.init(os.environ.get("RAY_HEAD_ADDRESS", ""))
#ray.init("ray://localhost:10001")
ray.init()
def ray_only():
serve.shutdown()
serve.start(detached=True, http_options={
"host": os.environ.get("RAY_IP", "0.0.0.0"),
"port": int(os.environ.get("RAY_PORT", 8000))
}
)
print(f"Starting Raypi on port {os.environ.get('RAY_PORT', 8000)}")
serve.run(Raypi.bind(), port=int(os.environ.get("RAY_PORT", 8000)), route_prefix="/sdapi/v1") #route_prefix="/sdapi/v1" # Call the launch_ray method to get the FastAPI app
print("Done setting up replicas! Now accepting requests...")
while True:
time.sleep(1000)