1234567891011121314151617181920212223242526272829303132333435363738 |
- import requests
- DDL_SERVER = "http://69.230.251.234:8081/api"
- script_path = "D://Git//ap-canvas-creation-module//04_stable_diffusion//sd_comfy_api.py"
- def send_sd_comfy_ddl_job(
- job_info={
- "Plugin": "Python",
- "Priority": 49,
- "Name": "ComfyUI Job",
- "Group": "general",
- # "PostJobScript": "C:/WORK/2022.DDL_Script/postJobTest.py",
- },
- plugin_info={"ScriptFile": script_path, "Version": "3.1"},
- ):
- url = f"{DDL_SERVER}/jobs"
- data = {
- "JobInfo": job_info,
- "PluginInfo": plugin_info,
- "AuxFiles": [],
- "IdOnly": True,
- }
- response = requests.post(url, json=data)
- if response.status_code == 200:
- print("Data posted successfully.")
- return response.json()
- else:
- print(f"Failed to post data. Status code: {response.status_code}")
- return None
- job = send_sd_comfy_ddl_job()
- job_id = job["_id"]
- print(f"Job ID: {job_id}")
|