Openjourney (SD-v1.5)
Openjourney is an open-source Stable Diffusion fine-tuned model on Midjourney images by PromptHero.
cURL
Python
NodeJS
Go
curl -X POST https://api.runpod.ai/v1/sd-openjourney/run \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{"input": {"prompt": "a cute magical flying dog, fantasy art drawn by disney concept artists"}}'
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "IN_QUEUE"
}
curl https://api.runpod.ai/v1/sd-openjourney/status/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
{
"delayTime": 123456, // (milliseconds) time in queue
"executionTime": 1234, // (milliseconds) time it took to complete the job
"gpu": "24", // gpu type used to run the job
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"input": {
"prompt": "a cute magical flying dog, fantasy art drawn by disney concept artists"
},
"output": [
{
"image": "https://job.results1",
"seed": 1
},
{
"image": "https://job.results2",
"seed": 2
}
],
"status": "COMPLETED"
}
import requests
# Set the API endpoint URL
endpoint = "https://api.runpod.ai/v1/sd-openjourney/run"
# Set the headers for the request
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
# Define your inputs
input_data = {
"input": {
"prompt": "My creative vision."
}
}
# Make the request
response = requests.post(endpoint, json=input_data, headers=headers)
# Print the response
print(response.text)
const request = require('request');
// Set the API endpoint and model name
const endpoint = 'https://api.runpod.ai/v1/sd-openjourney/run';
// Set the API key and input data
const apiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const inputData = {
input: {
prompt: 'My creative vision.',
},
};
// Set the headers for the request
const headers = {
'Content-Type': 'application/json',
Authorization: `Bearer ${apiKey}`,
};
// Make the request
request.post(
{
url: endpoint,
json: inputData,
headers,
},
(err, response) => {
if (err) {
console.error(err);
return;
}
// Print the response
console.log(response.body);
},
);
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
// Set the API endpoint and model name
endpoint := "https://api.runpod.ai/v1/sd-openjourney/run"
// Set the API key and input data
apiKey := "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
inputData := map[string]interface{}{
"input": map[string]string{
"prompt": "My creative vision.",
},
}
// Convert the input data to JSON
inputJSON, err := json.Marshal(inputData)
if err != nil {
log.Fatal(err)
}
// Set the headers for the request
headers := map[string][]string{
"Content-Type": {"application/json"},
"Authorization": {fmt.Sprintf("Bearer %s", apiKey)},
}
// Make the request
resp, err := http.Post(endpoint, "application/json", bytes.NewBuffer(inputJSON))
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
// Print the response
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(body))
}
post
https://api.runpod.ai
/v1/sd-openjourney/run
Run an inference request.
get
https://api.runpod.ai
/v1/sd-openjourney/status/{ REQUEST_ID }
Status and output of an inference request.
Last modified 2mo ago