We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1、在”图床安全“中找到”API上传“,一定要点保存
2、在”API设置“中添加token
有这两个操作,才能正确使用api上传功能
import requests # 本地图片文件路径 image_path = "/your_path/ComfyUI_00043_.png" # token值,需从实际来源获取(例如读取tokenList文件) token = "your_token_value" # 目标URL check_url = "https://your_url/api/public.php" upload_url = "https://your_url/api/index.php" # 构建请求参数 files = {'image':open(image_path, 'rb')} check_content = 'free_space' url = f"{check_url}?show={check_content}" data = {'token':token} # 发送get请求查询图床状态 这里也需要在”图床安全“中打开设置 response = requests.get(url) print(url) print(response.text) # 发送POST请求上传文件 response = requests.post(upload_url, files=files, data=data) # 检查响应状态码 if response.status_code == 200: print(response.status_code) print(response.json()) print("Upload successful.") else: print(f"Upload failed with status code {response.status_code}.")`
请愉快的玩耍吧!! 感谢开发者无偿的分享
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1、在”图床安全“中找到”API上传“,一定要点保存
2、在”API设置“中添加token
有这两个操作,才能正确使用api上传功能
请愉快的玩耍吧!!
感谢开发者无偿的分享The text was updated successfully, but these errors were encountered: