Generations
Generating new image
Generate new images
POST https://api.crazyhorse.ai/v1/generations
Generate new images by your purpose.
Headers
Name
Type
Description
api-key*
String
api key
Request Body
Name
Type
Description
params*
object
These params
hair: string,
pose: string,
body: string,
chest: string,
clothes: string,
background: string,
number: number,
girlId: string,
loraId: string (model),
debug: boolean,
image*
string
base64
{
"state": "WAITING",
"code": "string",
"imageUrls": [
"string"
],
"params": {
"hair": "string",
"pose": "string",
"body": "string",
"chest": "string",
"clothes": "string",
"background": "string",
"number": 10,
"loraId": "string",
"debug": true
}
}{
"message": "API key does not exist",
"errorCode": 5001,
"statusCode": 403,
"path": "/v1/generations",
"error": true,
"method": "POST"
}/ require the myapi module and set it up with your API key
const axios = require('axios').default;
const url = 'https://api.crazyhorse.ai/v1/generations';
const payload = {
params: {
"hair": "red",
"pose": "",
"body": "",
"chest": "",
"clothes": "t-shirt, jean",
"background": "ocean",
"number": 10,
"girlId": "yuna-jp",
"loraId": "115728",
"debug": true
},
image: '/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxISEhUTEBIVFRUVFRUVFRUVFRUVFRYVFxcXFxUVFRUYHSggGBolHRUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OGhAQGy0dHx0tLS0tLS0tLSstLS0tLS0tLSstKy0xLS0tKy0rLS0tLS0tKy0rKy0tLS0tLS0tLS0tLf/AABEIARMAtwMBIgACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAEAQIDBQYABwj/xAA/EAABAwIDBQUFBQgBBQEAAAABAAIRAyEEBTESQVFxgQYTImGRMqGxwdEHQlJichQjgpKy4fDxwhUzU5OiJP/EABkBAAMBAQEAAAAAAAAAAAAAAAABAgMEBf/EACERAQEAAgMAAgIDAAAAAAAAAAABAhEDITESQTJRBHHB/9oADAMBAAIRAxEAPwDSU/Y6KJgUwHg6KNgWSxdIWRYCHpDRFDR'
};
const options = {
headers: {
'api-key': 'xxxxxxxx'
}
};
const genImage = away axios.post(url, payload, options)Get Result
Get result for generate
GET https://api.crazyhorse.ai/v1/generations
Using code value to get result
Path Parameters
Name
Type
Description
code*
String
89e78b15d29165008cbfd61ba3bb679f
Headers
Name
Type
Description
api-key*
String
api key
{
"state": "DONE",
"code": "89e78b15d29165008cbfd61ba3bb679f",
"image": "ced3e3051c203193952d8b51fe5c9d82/89e78b15d29165008cbfd61ba3bb679f.png",
"generateImageUrls": [
"ced3e3051c203193952d8b51fe5c9d82/89e78b15d29165008cbfd61ba3bb679f/generate-1.png"
],
"params": {
"hair": "red",
"clothes": "t-shirt, jean",
"number": 1
},
"createdAt": "2023-10-09T11:11:07.174Z"
}{
"message": "API key does not exist",
"errorCode": 5001,
"statusCode": 403,
"path": "/v1/generations",
"error": true,
"method": "GET"
}/ require the myapi module and set it up with your API key
const axios = require('axios').default;
const url = 'https://api.crazyhorse.ai/v1/generations';
const options = {
headers: {
'api-key': 'xxxxxxxx'
}
};
const getResult = away axios.get(url, options)Last updated