diff --git a/comfyui/main.py b/comfyui/main.py index c6e75d7..33f32a6 100644 --- a/comfyui/main.py +++ b/comfyui/main.py @@ -33,35 +33,20 @@ def main(pid,orderId,styleNumber): print("弹出版本选择按钮已成功点击") time.sleep(3) # 使用XPath定位包含特定文本的div元素 - target_text = "3.小鱼AI(灰度图)图片浮雕流程-V3" + target_text = "深度图批处理" button = WebDriverWait(driver, 10).until( EC.element_to_be_clickable((By.XPATH, f'//div[contains(text(), "{target_text}")]')) ) button.click() print("选择版本按钮已成功点击") - - #通过url上传文件 - url = f"http://127.0.0.1:8188/api/upload/image" - imagePath = os.path.join(inputFolder, f"{pid}_{orderId}_{styleNumber}.png") - with open(imagePath, 'rb') as f: - files = {'file': f} - response = requests.post(url, files=files) - print(response.json()) - - - - - - time.sleep(5) - #点击上传按钮 - button = driver.find_element(By.ID, 'upload-button') + time.sleep(3) + # 使用XPath定位包含特定文本的div元素 + target_text = "Extra options" + button = WebDriverWait(driver, 10).until( + EC.element_to_be_clickable((By.XPATH, f'//label[contains(text(), "{target_text}")]')) + ) button.click() - time.sleep(5) - - - - # time.sleep(5) button = driver.find_element(By.ID, 'queue-button') @@ -189,7 +174,7 @@ if __name__ == '__main__': orderId = 0 styleNumber = 0 downloadPath = "D:\downloadPhotos" - inputFolder = "C:\StableDiffusion_xiaoyu_V3\ComfyUI-aki-v1.6-XY\ComfyUI\input" + inputFolder = "c:\deep" #"C:\StableDiffusion_xiaoyu_V3\ComfyUI-aki-v1.6-XY\ComfyUI\input" outputFolder = "C:\StableDiffusion_xiaoyu_V3\ComfyUI-aki-v1.6-XY\ComfyUI\output" jsonFilePath = "C:\StableDiffusion_xiaoyu_V3\ComfyUI-aki-v1.6-XY\ComfyUI\pysssss-workflows" # 设置浏览器驱动路径(以Chrome为例) @@ -221,12 +206,12 @@ if __name__ == '__main__': r = utils.create_redis_connection() while True: try: - if r.llen('model:badge_cartoon_test') == 0: + if r.llen('model:badge_cartoon') == 0: print('队列为空,等待10秒') time.sleep(10) continue - info = r.lpop('model:badge_cartoon_test') + info = r.lpop('model:badge_cartoon') if info is None: print('队列为空,等待10秒') time.sleep(10) @@ -251,7 +236,6 @@ if __name__ == '__main__': print(f"pid:{pid} orderId:{orderId} style_number:{styleNumber}") if pid > 0 and orderId > 0 and styleNumber > 0: main(pid,orderId,styleNumber) - break except json.JSONDecodeError as e: print(f'JSON解析错误:{e}') utils.notify(f'JSON解析错误:{e}')