说明:先按需修改脚本内 MODEL_PATH、lora_path、输入图路径等,再执行。
run_1card.shbash run_1card.shrun_image_2card_current_best.shbash run_image_2card_current_best.shrun_edit_1card.shbash run_edit_1card.shrun_edit_2card.shbash run_edit_2card.sh默认端口统一为 8000。
run_server_image_1card_current_best.shbash run_server_image_1card_current_best.shrun_server_image_2card_current_best.shbash run_server_image_2card_current_best.shrun_server_edit_1card_current_best.shbash run_server_edit_1card_current_best.shrun_server_edit_2card_current_best.shbash run_server_edit_2card_current_best.shPOST /qwenimagehttp://127.0.0.1:8000/qwenimage示例:
curl -X POST "http://127.0.0.1:8000/qwenimage" \
-H "Content-Type: application/json" \
-d "{\"prompt\":\"A cute cat drinking coffee, cinematic, 4k\",\"width\":1024,\"height\":1024,\"steps\":8}"POST /qwenimage_edit(兼容 POST /qwenimage)http://127.0.0.1:8000/qwenimage_editprompt + 图像输入(image/images/image_path/image_paths 之一)示例(服务端本地路径):
curl -X POST "http://127.0.0.1:8000/qwenimage_edit" \
-H "Content-Type: application/json" \
-d "{\"prompt\":\"Make Pikachu hold a sign says Qwen Edit is awesome\",\"image_path\":\"examples/yarn-art-pikachu.png\",\"width\":1024,\"height\":1024,\"steps\":8}"batch_generate_via_api.pyprompts.txt(每行一个提示词)python batch_generate_via_api.py --prompts_file prompts.txtbatch_edit_via_api.pyjobs.json(JSON 数组,每条任务至少包含 prompt + 图像输入)edit_jobs_example.jsonpython batch_edit_via_api.py --jobs_file edit_jobs_example.jsonresult 是 base64 编码图片。results.json 记录耗时与返回信息。