diff --git a/nodes.py b/nodes.py index 226690f..bf1b2ba 100644 --- a/nodes.py +++ b/nodes.py @@ -62,14 +62,15 @@ def _submit_request(endpoint, payload, timeout, api_key): if not request_id: raise RuntimeError(f"No request_id in queue response: {queue_data}") - # fal.ai app ID is "owner/name" (first two segments); any extra segments - # (e.g. /edit) are routes within the app and must NOT appear in the - # status / result polling URLs. - parts = endpoint.split("/", 2) - app_id = f"{parts[0]}/{parts[1]}" - - status_url = f"https://queue.fal.run/{app_id}/requests/{request_id}/status" - result_url = f"https://queue.fal.run/{app_id}/requests/{request_id}" + # Use the URLs returned by fal.ai (they include the correct app path). + status_url = queue_data.get( + "status_url", + f"https://queue.fal.run/{endpoint}/requests/{request_id}/status", + ) + result_url = queue_data.get( + "response_url", + f"https://queue.fal.run/{endpoint}/requests/{request_id}", + ) deadline = time.time() + timeout while time.time() < deadline: