Constructor
Signature
Properties
bool
Check if WebSocket connection is active.
int
Number of published requests awaiting responses.
str
WebSocket URL this client connects to.
Methods
available_models()
Signature
close()
Signature
collect()
Signature
If provided, collect exactly this many results. If None, collect until no pending requests remain.
connect()
Signature
help()
Signature
publish()
Signature
required
Model to run (ModelType enum or string)
Optional ID to track this request. Auto-generated if not provided.
Model-specific parameters (e.g., image_input, prompt)
run()
Signature
required
Model to run (ModelType enum or string)
Model-specific parameters (e.g., image_input, prompt)
submit()
Signature
async with CortexHubClient() as hub: … depth_t = hub.submit(ModelType.ZOEDEPTH, image_input=img) … mask_t = hub.submit(ModelType.GSAM2, image_input=img, prompt=“cat”) … depth_res, mask_res = await asyncio.gather(depth_t, mask_t)
subscribe()
Signature
If provided, stop after receiving this many results. If None, yields indefinitely until no pending requests remain.