Spaces:
Running
Running
Update index.html
Browse files- index.html +4 -3
index.html
CHANGED
@@ -34,6 +34,7 @@ background-color: #00000080;
|
|
34 |
<div style="text-align:center; display:flex;items-align:center;align-items:center;justify-content:center; overflow:auto;" width="80%" height="30%" id="image-container"></div>
|
35 |
|
36 |
<script>
|
|
|
37 |
var javas = document.querySelector('#javas');
|
38 |
javas.height = window.innerHeight*65/100;
|
39 |
javas.width = window.innerWidth*65/100;
|
@@ -100,7 +101,7 @@ try {
|
|
100 |
var anputText = document.querySelector('#input-text').value;
|
101 |
var apiUrl = 'https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2-1';
|
102 |
var aeaders = new Headers();
|
103 |
-
aeaders.append('Authorization', 'Bearer
|
104 |
aeaders.append('Accept', 'image/jpeg'),
|
105 |
aeaders.append('Content-Type', 'application/json');
|
106 |
var aody = JSON.stringify({ inputs: "cinematographic style, 4k, hi-res, dslr style, high-quality, render: " + anputText + " " + Date.now() + "", options: { wait_for_model: true } });
|
@@ -132,7 +133,7 @@ try {
|
|
132 |
var bnputText = document.querySelector('#input-text').value;
|
133 |
var bpiUrl = 'https://api-inference.huggingface.co/models/prompthero/openjourney';
|
134 |
var beaders = new Headers();
|
135 |
-
beaders.append('Authorization', 'Bearer
|
136 |
beaders.append('Accept', 'image/jpeg'),
|
137 |
beaders.append('Content-Type', 'application/json');
|
138 |
var body = JSON.stringify({ inputs: "cinematographic style, 4k, hi-res, dslr style, high-quality, render: " + bnputText + " " + Date.now() + "", options: { wait_for_model: true, } });
|
@@ -163,7 +164,7 @@ try {
|
|
163 |
var cnputText = document.querySelector('#input-text').value;
|
164 |
var cpiUrl = 'https://api-inference.huggingface.co/models/runwayml/stable-diffusion-v1-5';
|
165 |
var ceaders = new Headers();
|
166 |
-
ceaders.append('Authorization', 'Bearer
|
167 |
ceaders.append('Accept', 'image/jpeg'),
|
168 |
ceaders.append('Content-Type', 'application/json');
|
169 |
var cody = JSON.stringify({ inputs: "cinematographic style, 4k, hi-res, dslr style, high-quality, render: " + cnputText + " " + Date.now() + "", options: { wait_for_model: true } });
|
|
|
34 |
<div style="text-align:center; display:flex;items-align:center;align-items:center;justify-content:center; overflow:auto;" width="80%" height="30%" id="image-container"></div>
|
35 |
|
36 |
<script>
|
37 |
+
var HF_API = prompt("Enter your HF API key")
|
38 |
var javas = document.querySelector('#javas');
|
39 |
javas.height = window.innerHeight*65/100;
|
40 |
javas.width = window.innerWidth*65/100;
|
|
|
101 |
var anputText = document.querySelector('#input-text').value;
|
102 |
var apiUrl = 'https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2-1';
|
103 |
var aeaders = new Headers();
|
104 |
+
aeaders.append('Authorization', 'Bearer ' + HF_API + '');
|
105 |
aeaders.append('Accept', 'image/jpeg'),
|
106 |
aeaders.append('Content-Type', 'application/json');
|
107 |
var aody = JSON.stringify({ inputs: "cinematographic style, 4k, hi-res, dslr style, high-quality, render: " + anputText + " " + Date.now() + "", options: { wait_for_model: true } });
|
|
|
133 |
var bnputText = document.querySelector('#input-text').value;
|
134 |
var bpiUrl = 'https://api-inference.huggingface.co/models/prompthero/openjourney';
|
135 |
var beaders = new Headers();
|
136 |
+
beaders.append('Authorization', 'Bearer ' + HF_API + '');
|
137 |
beaders.append('Accept', 'image/jpeg'),
|
138 |
beaders.append('Content-Type', 'application/json');
|
139 |
var body = JSON.stringify({ inputs: "cinematographic style, 4k, hi-res, dslr style, high-quality, render: " + bnputText + " " + Date.now() + "", options: { wait_for_model: true, } });
|
|
|
164 |
var cnputText = document.querySelector('#input-text').value;
|
165 |
var cpiUrl = 'https://api-inference.huggingface.co/models/runwayml/stable-diffusion-v1-5';
|
166 |
var ceaders = new Headers();
|
167 |
+
ceaders.append('Authorization', 'Bearer ' + HF_API + '');
|
168 |
ceaders.append('Accept', 'image/jpeg'),
|
169 |
ceaders.append('Content-Type', 'application/json');
|
170 |
var cody = JSON.stringify({ inputs: "cinematographic style, 4k, hi-res, dslr style, high-quality, render: " + cnputText + " " + Date.now() + "", options: { wait_for_model: true } });
|