-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
21 lines (19 loc) · 790 Bytes
/
Copy pathapp.py
File metadata and controls
21 lines (19 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import requests
response = requests.post(
f"apikey",
headers={
"authorization": apadas",
"accept": "image/*"
},
files={"none": ''},
data={
"prompt": "A large Great Dane dog, approximately 90 cm tall, with a white coat and black spots, standing on a sandy beach and gazing out over the ocean. The dog has a sleek black leash attached to its collar. The scene captures a tranquil, bright day with gentle ocean waves in the background and a vast sky above, emphasizing the dog's calm and reflective posture.",
"size": "1024x1024",
"output_format": "jpeg",
},
)
if response.status_code == 200:
with open("./greatdane.jpeg", 'wb') as file:
file.write(response.content)
else:
raise Exception(str(response.json()))