Add --remote support to reload command
Now uses default remote like other commands. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+6
-3
@@ -558,13 +558,16 @@ def status(
|
|||||||
@app.command()
|
@app.command()
|
||||||
def reload(
|
def reload(
|
||||||
model: Annotated[str, typer.Option(help="Path to model file for sd-server.")],
|
model: Annotated[str, typer.Option(help="Path to model file for sd-server.")],
|
||||||
host: Annotated[str, typer.Option(help="Wrapper API host.")] = "127.0.0.1",
|
remote: Annotated[str | None, typer.Option("-r", "--remote", help="Remote server name or URL")] = None,
|
||||||
port: Annotated[int, typer.Option(help="Wrapper API port.")] = 8080,
|
host: Annotated[str, typer.Option(help="Wrapper API host (local mode).")] = "127.0.0.1",
|
||||||
|
port: Annotated[int, typer.Option(help="Wrapper API port (local mode).")] = 8080,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Reload sd-server with a new model."""
|
"""Reload sd-server with a new model."""
|
||||||
import httpx # noqa: PLC0415
|
import httpx # noqa: PLC0415
|
||||||
|
|
||||||
url = f"http://{host}:{port}/reload"
|
remote_url = resolve_remote(remote)
|
||||||
|
url = f"{remote_url.rstrip('/')}/reload" if remote_url else f"http://{host}:{port}/reload"
|
||||||
|
|
||||||
console.print(f"[cyan]Reloading model: {model}[/cyan]")
|
console.print(f"[cyan]Reloading model: {model}[/cyan]")
|
||||||
try:
|
try:
|
||||||
resp = httpx.post(url, json={"model": model}, timeout=300)
|
resp = httpx.post(url, json={"model": model}, timeout=300)
|
||||||
|
|||||||
Reference in New Issue
Block a user