Good to know: All GenAI interfaces need to use token as the request header.
Base GenAI
Generating an image by base mode
POST
https://www.phoenix.global/sdk/computation/LLM/callGenImage
Request Body
{
"code": 200,
"msg": "success",
"path": "http://xxxxxx.jpg",
"tokens_balance": 43400
}
The usage of curl and golang sdk is as follows:
curl --location 'https://www.phoenix.global/sdk/computation/LLM/callGenImage' \
--header 'Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs' \
--header 'Content-Type: application/json' \
--data '{
"negative_prompt": "ugly,watermark,jpeg artifacts,error,text,username",
"prompt": "iron man skiing on steep slope, hd, high quality"
}'
package main
import (
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/common"
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers"
)
func main2() {
tokenStr := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs"
reqBody := common.ReqGenImage{
Prompt: "iron man skiing on steep slope",
NegativePromt: "FastNegativeV2, (low quality:1.3),(worst quality:1.3),(monochrome:0.8),(deformed:1.3),(malformed hands:1.4),(poorly drawn hands:1.4),(mutated fingers:1.4),(bad anatomy:1.3),(extra limbs:1.35),(poorly drawn face:1.4),(watermark:1.3),ugly,watermark,jpeg artifacts,error,text,username",
UserToken: tokenStr,
}
result, err := controllers.GenImage(reqBody)
......
}
SDXL GenAI
Generating an image by SDXL mode
POST
https://www.phoenix.global/sdk/computation/LLM/callGenSDXLImage
Request Body
{
"code": 200,
"msg": "success",
"path": "http://xxxxxx.jpg",
"tokens_balance": 43400
}
The usage of curl and golang sdk is as follows:
curl --location 'https://www.phoenix.global/sdk/computation/LLM/callGenSDXLImage' \
--header 'Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "iron man skiing on steep slope, hd, high quality",
"negative_prompt": "ugly,watermark,jpeg artifacts,error,text,username"
}'
package main
import (
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/common"
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers"
)
func main2() {
tokenStr := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs"
reqBody := common.ReqGenSDXLImage{
Prompt: "iron man skiing on steep slope",
NegativePromt: "FastNegativeV2, (low quality:1.3),(worst quality:1.3),(monochrome:0.8),(deformed:1.3),(malformed hands:1.4),(poorly drawn hands:1.4),(mutated fingers:1.4),(bad anatomy:1.3),(extra limbs:1.35),(poorly drawn face:1.4),(watermark:1.3),ugly,watermark,jpeg artifacts,error,text,username",
UserToken: tokenStr,
}
result, err := controllers.GenSDXLImage(reqBody)
......
}
Text to Motion
Generating a gif from prompts
POST
https://www.phoenix.global/sdk/computation/LLM/callTextToMotion
Request Body
{
"code": 200,
"msg": "success",
"path": "http://xxxxxx.jif",
"tokens_balance": 43400
}
The usage of curl and golang sdk is as follows:
curl --location 'https://www.phoenix.global/sdk/computation/LLM/callTextToMotion' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "iron man skiing on steep slope, hd, high quality",
"negative_prompt": "blurry"
}'
package main
import (
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/common"
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers"
)
func main2() {
tokenStr := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IjExMUBnbWFpbC5jb20iLCJleHAiOjE2NzgyNzM4Mjh9.7Qy6jh5L1qvVVbOZYR3JrmWdothI2SCF-oGyC2BfZDs"
reqBody := common.ReqTextToMotion{
Prompt: "iron man skiing on steep slope",
NegativePromt: "FastNegativeV2, (low quality:1.3),(worst quality:1.3),(monochrome:0.8),(deformed:1.3),(malformed hands:1.4),(poorly drawn hands:1.4),(mutated fingers:1.4),(bad anatomy:1.3),(extra limbs:1.35),(poorly drawn face:1.4),(watermark:1.3),ugly,watermark,jpeg artifacts,error,text,username",
UserToken: tokenStr,
}
result, err := controllers.TextToMotion(reqBody)
......
}
Image to Motion
Generating a gif from an image
POST
https://genapi.phoenix.global/sdk/computation/LLM/callImgToMotion
Headers
Body
Response
{
"code": 200,
"msg": "success",
"path": "https://xxxxxx.jif",
"tokens_balance": 43400
}
The usage of curl and golang sdk is as follows:
curl --location 'https://genapi.phoenix.global/sdk/computation/LLM/callImgToMotion' \
--header 'token: eyJhxxxxxxiCGOK2hWU' \
--header 'Content-Type: application/json' \
--data '{
"image_path": "https://xxxxxx.jpeg"
}'
package main
import (
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/common"
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers"
)
func imgToMotion111() {
tokenStr := "eyJhbGciOiJIxxxxxxblc"
reqBody := common.ReqImgToMotion{
ImagePath: "https://xxxxxx.jpeg",
UserToken: tokenStr,
}
res, err := controllers.ImgToMotion(reqBody)
......
}