mock stable diffusion api with websockets
Install environment
poetry install
Start the server
python -m app.main --reload
Client example
Using websocket-client
.
import websocket
def on_message(wsapp, message):
print(message)
ws = websocket.WebSocket()
ws.connect("ws://localhost:8000/ws")
ws.send("hello")
print(ws.recv())
ws.close()