sd_comfy_deadline.py 870 B

12345678910111213141516171819202122232425262728293031323334
  1. import requests
  2. DDL_SERVER = "http://69.230.251.234:8081/api"
  3. script_path = "D://Temp//ComfyUI_windows_portable_nvidia//ComfyUI_windows_portable//ComfyUI//script_examples//custom//basic_api_example - Copy.py"
  4. def send_ddl_job(
  5. job_info={
  6. "Plugin": "Python",
  7. "Priority": 49,
  8. "Name": "ComfyUI Job",
  9. "Group": "general",
  10. },
  11. plugin_info={"ScriptFile": script_path, "Version": "3.1"},
  12. ):
  13. url = f"{DDL_SERVER}/jobs"
  14. data = {
  15. "JobInfo": job_info,
  16. "PluginInfo": plugin_info,
  17. "AuxFiles": [],
  18. "IdOnly": True,
  19. }
  20. response = requests.post(url, json=data)
  21. if response.status_code == 200:
  22. print("Data posted successfully.")
  23. return response.json()
  24. else:
  25. print(f"Failed to post data. Status code: {response.status_code}")
  26. return None
  27. send_ddl_job()