Skip to content

Commit

Permalink
Fix DALL-E default endpoints in the code
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorgalvao committed Nov 28, 2024
1 parent e4ad52b commit 033f600
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Workflow/dalle
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ function run(argv) {
const maxEntries = 10
const apiKey = envVar("openai_api_key")
const apiOrgHeader = envVar("openai_org_id") ? ["--header", `OpenAI-Organization: ${envVar("openai_org_id")}`] : []
const apiEndpointInit = envVar("dalle_api_endpoint") || "https://api.openai.com/v1/images/completions"
const apiEndpointInit = envVar("dalle_api_endpoint") || "https://api.openai.com/v1/images/generations"
const apiEndpointInitHasPath = apiEndpointInit.replace(/^https?:\/\//, "").includes("/")
const apiEndpoint = apiEndpointInitHasPath ? apiEndpointInit : `${apiEndpointInit}/v1/images/completions`
const apiEndpoint = apiEndpointInitHasPath ? apiEndpointInit : `${apiEndpointInit}/v1/images/generations`
const model = envVar("dalle_model")
const imageNumber = parseInt(envVar("dalle_image_number"))
const imageStyle = envVar("dalle_style")
Expand Down

0 comments on commit 033f600

Please sign in to comment.