""" 配置文件 包含API密钥、模型配置等常量 """ # ==================== API配置 ==================== # 豆包API配置 (api_key, base_url) doubao_ky = ( "817dff39-5586-4f9b-acba-55004167c0b1", "https://ark.cn-beijing.volces.com/api/v3" ) # 阿里云API配置 (api_key, base_url) ali_ky = ( "sk-04b63960983445f980d85ff185a17876", "https://dashscope.aliyuncs.com/compatible-mode/v1" ) # ==================== 模型配置 ==================== # 豆包模型配置 doubao_model = { "text_doubao": "ep-20241018084532-cgm84", "text_ds": "deepseek-r1-250120", "mm_doubao": "doubao-1-5-vision-pro-32k-250115" } # 阿里云模型配置 ali_model = { "text_qwen": "qwen3-max", # 注意:覆盖了前面的 "qwen-max-2025-01-25" "text_ds": "deepseek-r1", "text_dsv3": "deepseek-v3", "mm_tyqw": "qwen-vl-max", "mm_qwen": "qwen3-vl-plus" } import requests size_dict={ "1600x1600":[1,1], "1800x2400":[3,4], "1600x2400":[2,3], "1080x1350":[4,5], "1200x1500":[4,5], "1920x1080":[16,9], "2000x2000":[1,1]} # API_KEY="sk-qnsfJw0vsAitlnrXcOeBYrLbTv9LXfsN1m3jIUfMJagan5IR", # BASE_URL="https://api.openaius.com/" check_prompt="""图2是不是图1的衣服的线稿款式图,而且除了衣服的线稿外没有其他的元素了?是不是只有黑白线稿没有颜色的,是不是不含人台(mannequin)的线稿,是不是衣服的数量和特征都对应上了,是的话回答是,否则回答否""" if __name__ == '__main__': ratio=(2,3) print(size_dict) # print(size_url[str(ratio[0])+":"+str(ratio[1])]) import io from PIL import Image # 下载原图为 PIL.Image resp_img = requests.get("https://v3.fal.media/files/monkey/gtn7F5ZWMJ2SwcdWiwpkh.jpeg", timeout=30) resp_img.raise_for_status() pil_image = Image.open(io.BytesIO(resp_img.content)).convert("RGB") print(pil_image)