Step 1: Generate Image from Prompt
When you have your access_token from previous tutorial we can start create images:
Use the /image/txt2img endpoint to generate an image based on a prompt:
POST: /image/txt2img
Request:
{
“imagePrompt”: “string”
}
Authorization: Bearer your_access_token
Response:
{
“imageUrl”: “url_to_your_image”,
“imagePrompt”: “your_prompt”
}
!!! Ensure the Authorization header includes the bearer token obtained during the login process. !!!
Step 2: Retrieve All User Images
Retrieve all images associated with the user using the /image endpoint:
GET /images
Authorization: Bearer your_access_token
Response:
[
{
“imageUrl”: “url_to_your_image”,
“imagePrompt”: “your_prompt”
},
{
“imageUrl”: “url_to_your_image”,
“imagePrompt”: “your_prompt”
},
]
!!! Ensure the Authorization header includes the bearer token obtained during the login process. !!!