Skip to content

Commit

Permalink
added custom dalle names
Browse files Browse the repository at this point in the history
  • Loading branch information
Concedo authored and Concedo committed Sep 23, 2024
1 parent 9167f87 commit 89b1ce2
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4185,6 +4185,7 @@

const default_oai_image_endpoint = "/images/generations";
const default_oai_tts_endpoint = "/audio/speech";
const default_dalle_model_name = "dall-e-3";

const claude_submit_endpoint = "/complete";
const claude_submit_endpoint_v3 = "/messages";
Expand Down Expand Up @@ -4325,6 +4326,7 @@
saved_oai_addr: default_oai_base, //do not ever share this in save files!
saved_dalle_key: "",
saved_dalle_url: (default_oai_base + "/v1" + default_oai_image_endpoint),
saved_dalle_model: default_dalle_model_name,
saved_oai_tts_key: "",
saved_oai_tts_url: (default_oai_base + "/v1" + default_oai_tts_endpoint),
saved_openrouter_key: "",
Expand Down Expand Up @@ -5390,6 +5392,18 @@
}
},false);
}
function set_dalle_model()
{
inputBox("Enter DALL-E API Model Identifier.","DALL-E API Model Identifier",localsettings.saved_dalle_model,"Input DALL-E Model Identifier", ()=>{
let userinput = getInputBoxValue();
userinput = userinput.trim();
if (userinput != null && userinput!="") {
localsettings.saved_dalle_model = userinput.trim();
}else{
localsettings.saved_dalle_model = default_dalle_model_name;
}
},false);
}

function set_oai_tts_key()
{
Expand Down Expand Up @@ -5421,7 +5435,7 @@
let prompt = splits[0].trim();

let dalle_payload = {
"model": "dall-e-3",
"model": localsettings.saved_dalle_model,
"prompt": prompt,
"n": 1,
"size": "1024x1024",
Expand Down Expand Up @@ -18721,8 +18735,9 @@
</div>
<div id="generate_images_dalle_container" class="settinglabel hidden">
<table width="100%"><tr>
<td><button id="generate_images_dalle_setkey" type="button" class="btn btn-primary" style="width:100%; padding:2px 3px;margin-top:2px;font-size:11px;" onclick="set_dalle_url()">Set URL</button></td>
<td><button id="generate_images_dalle_seturl" type="button" class="btn btn-primary" style="width:100%; padding:2px 3px;margin-top:2px;font-size:11px;" onclick="set_dalle_key()">Set Key</button></td>
<td><button type="button" class="btn btn-primary" style="width:100%; padding:2px 3px;margin-top:2px;font-size:11px;" onclick="set_dalle_url()">Set URL</button></td>
<td><button type="button" class="btn btn-primary" style="width:100%; padding:2px 3px;margin-top:2px;font-size:11px;" onclick="set_dalle_key()">Set Key</button></td>
<td><button type="button" class="btn btn-primary" style="width:100%; padding:2px 3px;margin-top:2px;font-size:11px;" onclick="set_dalle_model()">Model</button></td>
</tr></table>
</div>

Expand Down

0 comments on commit 89b1ce2

Please sign in to comment.