12345678910111213141516171819202122232425262728293031 |
- import requests
- url = 'https://dashscope.aliyuncs.com/api/v1/services/aigc/virtualmodel/generation/'
- DASHSCOPE_API_KEY = "sk-36a7725c51be4ffe8d3374ea534014b6"
- headers = {
- 'X-DashScope-Async': 'enable',
- 'Authorization': f'Bearer {DASHSCOPE_API_KEY}', # 确保你已经设置了 DASHSCOPE_API_KEY
- 'Content-Type': 'application/json'
- }
- data = {
- "model": "shoemodel-v1",
- "input": {
- "template_image_url": "https://infish-oss.oss-cn-beijing.aliyuncs.com/test/model2.jpg",
- "shoe_image_url": ["https://infish-oss.oss-cn-beijing.aliyuncs.com/test/shoe3.png"]
- },
- "parameters": {
- "n": 1
- }
- }
- task_id = "6488c66d-2a0c-4134-90bb-39ab957d6cdf"
- returl = f'https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}'
- headersret = {
- 'Authorization': f'Bearer {DASHSCOPE_API_KEY}', # 确保你已经设置了 DASHSCOPE_API_KEY
- }
- # response = requests.post(url, headers=headers, json=data)
- # print(response.json())
- response = requests.get(returl, headers=headersret)
- print(response.json())
|