MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / request_t2i_sync

Function request_t2i_sync

scripts/server/post_sync_t2i_base64.py:23–33  ·  view source on GitHub ↗
(
    base_url: str,
    payload: dict,
    timeout_seconds: int,
    poll_interval_seconds: float,
)

Source from the content-addressed store, hash-verified

21
22def request_t2i_sync(
23 base_url: str,
24 payload: dict,
25 timeout_seconds: int,
26 poll_interval_seconds: float,
27) -> bytes:
28 endpoint = f"{base_url.rstrip('/')}/v1/tasks/sync?timeout_seconds={timeout_seconds}&poll_interval_seconds={poll_interval_seconds}"
29 response = requests.post(endpoint, json=payload, timeout=timeout_seconds + 30)
30 if response.status_code != 200:
31 raise RuntimeError(f"Sync t2i failed ({response.status_code}): {response.text}")
32 return response.content
33
34
35def save_result(content: bytes, output_path: str) -> Path:
36 output = Path(output_path)

Callers 1

mainFunction · 0.85

Calls 1

postMethod · 0.80

Tested by

no test coverage detected