luisrguerra
commited on
Commit
·
b94e926
1
Parent(s):
a1aede1
Update index.html
Browse files- index.html +146 -40
index.html
CHANGED
@@ -2,24 +2,27 @@
|
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
-
<!-- smartphone fix -->
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
7 |
-
<title>
|
8 |
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
9 |
<!--Bootstrap -->
|
10 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.1/js/bootstrap.min.js" integrity="sha512-fHY2UiQlipUq0dEabSM4s+phmn+bcxSYzXP4vAXItBvBHU7zAM/mkhCZjtBEIJexhOMzZbgFlPLuErlJF2b+0g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
11 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.1/css/bootstrap.min.css" integrity="sha512-Z/def5z5u2aR89OuzYcxmDJ0Bnd5V1cKqBEbvLOiUNWdg9PQeXVvXLI90SE4QOHGlfLqUnDNVAYyZi8UwUTmWQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
|
|
|
|
|
|
|
|
12 |
</head>
|
13 |
-
<body style="padding-inline: 0.
|
14 |
<label for="promptInput" class="form-label">Prompt:</label>
|
15 |
-
<input type="text" id="promptInput" class="form-control" placeholder="
|
16 |
<br>
|
17 |
<label for="negativePromptInput" class="form-label">Negative Prompt:</label>
|
18 |
-
<input type="text" id="negativePromptInput" class="form-control" placeholder="
|
19 |
<br>
|
20 |
<div class="row">
|
21 |
<div class="col">
|
22 |
-
<label for="styleSelect" class="form-label">
|
23 |
<select id="styleSelect" class="form-select">
|
24 |
</select>
|
25 |
</div>
|
@@ -40,14 +43,14 @@
|
|
40 |
<div class="accordion-item">
|
41 |
<h2 class="accordion-header">
|
42 |
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
|
43 |
-
Advanced
|
44 |
</button>
|
45 |
</h2>
|
46 |
<div id="flush-collapseOne" class="accordion-collapse collapse" data-bs-parent="#accordionFlushAdvancedOptions">
|
47 |
<br>
|
48 |
<!--Number of inference steps-->
|
49 |
<label for="numInferenceStepsInput" class="form-label">Number of inference steps:</label>
|
50 |
-
<input type="number" id="numInferenceStepsInput" class="form-control" value="20" placeholder="Number of inference steps" min="
|
51 |
<br>
|
52 |
<!--Guidance scale-->
|
53 |
<label for="guidanceScaleInput" class="form-label">Guidance Scale:</label>
|
@@ -57,6 +60,31 @@
|
|
57 |
<label for="seedInput" class="form-label">Seed:</label>
|
58 |
<input type="number" id="seedInput" class="form-control" value="0" placeholder="Seed" min="0">
|
59 |
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
<!--Deepinfra API token-->
|
61 |
<label for="authTokenInput" class="form-label">Deepinfra API token:</label>
|
62 |
<input type="password" id="authTokenInput" class="form-control" placeholder="Deepinfra API token">
|
@@ -64,12 +92,16 @@
|
|
64 |
</div>
|
65 |
</div>
|
66 |
<br>
|
67 |
-
<button id="generateButton" class="btn btn-
|
68 |
<br><br>
|
69 |
-
<
|
|
|
|
|
70 |
</body>
|
71 |
<script type="module">
|
72 |
|
|
|
|
|
73 |
const stylesArray = [
|
74 |
{
|
75 |
name:'Default',
|
@@ -78,7 +110,17 @@ const stylesArray = [
|
|
78 |
},
|
79 |
{
|
80 |
name:'Anime',
|
81 |
-
prompt: ',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
negative_prompt: ',black and white,b&w, monochrome, 3d render, photography, photo, [cartoon], abstract art, poorly drawn, (text), (dialog bubble), (letters), [cartoon comics], [superhero comics], signature, [minimalist art], 3d model, amateur anime artist,canvas frame,bad art,ugly,nude,porn,naked,nsfw,hentai,'
|
83 |
},
|
84 |
{
|
@@ -86,11 +128,21 @@ const stylesArray = [
|
|
86 |
prompt: ',sharp image, full hd, 1080p,4k, [8k] ,[uhd], high quality, detailed, high resolution, [high res],[RAW photo], [HDR], [hard shadows], [cinematic shot], [dramatic lighting], [soft lighting], [dslr], professional photographer,photorealistic, realistic,real,',
|
87 |
negative_prompt: ',blurry, low res, low resolution, low quality,ugly,nude,porn,naked,nsfw,hentai,'
|
88 |
},
|
|
|
|
|
|
|
|
|
|
|
89 |
{
|
90 |
name:'Renaissance',
|
91 |
prompt: ',renaissance painting style, [chiaroscuro],[detailed brushwork],[classical beauty],oil on canvas,[classical art],[historical art],oil painting,[fine details],[perspective],[masterpiece],[artwork style],[sharp image],[high resolution],[detailed],[professional style],[frescoes],',
|
92 |
negative_prompt: ',(black and white),sepia,blurry, low res, low resolution, low quality,ugly,artist painting,artist drawing,(digital painting style),3d render,photo,nude,porn,naked,nsfw,'
|
93 |
},
|
|
|
|
|
|
|
|
|
|
|
94 |
{
|
95 |
name:'Impressionism',
|
96 |
prompt: ',impressionist painting style,[brushstrokes],[loose brushwork style],[natural light],[vibrant colors],[oil on canvas],',
|
@@ -108,17 +160,22 @@ const stylesArray = [
|
|
108 |
},
|
109 |
{
|
110 |
name: "Art Nouveau",
|
111 |
-
prompt: ",Art Nouveau
|
112 |
-
negative_prompt: ",
|
|
|
|
|
|
|
|
|
|
|
113 |
},
|
114 |
{
|
115 |
name: "Faded Polaroid Photo",
|
116 |
prompt: ",Faded Polaroid Photo, analog, old faded photo, old polaroid,",
|
117 |
-
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast, vibrant,
|
118 |
},
|
119 |
{
|
120 |
name: "Japanese Ink Drawing",
|
121 |
-
prompt: ",Japanese Ink Drawing, ink drawing, inkwash, Japanese Ink Drawing,",
|
122 |
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast, colorful, vibrant,"
|
123 |
},
|
124 |
{
|
@@ -131,11 +188,6 @@ const stylesArray = [
|
|
131 |
prompt: ",Vector Art Stickers, professional vector design, sticker designs, Sticker Sheet,",
|
132 |
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast,"
|
133 |
},
|
134 |
-
{
|
135 |
-
name: "Action Figure",
|
136 |
-
prompt: ",Action Figure, plastic collectable action figure, collectable toy action figure,",
|
137 |
-
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast,"
|
138 |
-
},
|
139 |
{
|
140 |
name: "Art Deco",
|
141 |
prompt: ",Art Deco, sleek, geometric forms, art deco style,",
|
@@ -144,32 +196,27 @@ const stylesArray = [
|
|
144 |
{
|
145 |
name: "Flat 2D Art",
|
146 |
prompt: ",Flat 2D Art, simple flat color, 2-dimensional, Flat 2D Art Style,",
|
147 |
-
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast, 3D, photo, realistic,"
|
148 |
},
|
149 |
{
|
150 |
name: "Baroque",
|
151 |
prompt: ",Baroque, dramatic, exuberant, grandeur, baroque art,",
|
152 |
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast,"
|
153 |
},
|
154 |
-
{
|
155 |
-
name: "Doodle Art",
|
156 |
-
prompt: ",Doodle Art Style, drawing, freeform, swirling patterns, doodle art style,",
|
157 |
-
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast,"
|
158 |
-
},
|
159 |
{
|
160 |
name: "Medievalism",
|
161 |
-
prompt: ",Medievalism, inspired by The Middle Ages, medieval art, elaborate patterns and decoration, Medievalism,",
|
162 |
-
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast,"
|
163 |
},
|
164 |
{
|
165 |
name: "Pencil Sketch Drawing",
|
166 |
-
prompt: ",Pencil Sketch Drawing, black and white drawing, graphite drawing,",
|
167 |
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast,"
|
168 |
},
|
169 |
{
|
170 |
name: "3D Model",
|
171 |
-
prompt: ",professional 3d model, octane render, highly detailed, volumetric, dramatic lighting,",
|
172 |
-
negative_prompt: ",ugly, deformed, noisy, low poly, blurry, painting,"
|
173 |
},
|
174 |
{
|
175 |
name: "Analog Film",
|
@@ -189,7 +236,52 @@ const stylesArray = [
|
|
189 |
{
|
190 |
name: "Pixel art",
|
191 |
prompt: ",pixel-art, low-res, blocky, pixel art style, 8-bit graphics,",
|
192 |
-
negative_prompt: ",sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic,"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
},
|
194 |
]
|
195 |
|
@@ -215,8 +307,6 @@ function loadStyleSelect() {
|
|
215 |
}
|
216 |
loadStyleSelect();
|
217 |
|
218 |
-
|
219 |
-
|
220 |
document.getElementById('generateButton').addEventListener('click', generateImage);
|
221 |
async function generateImage(){
|
222 |
const authTokenTemp = document.getElementById('authTokenInput').value;
|
@@ -229,7 +319,9 @@ async function generateImage(){
|
|
229 |
const guidanceScale = document.getElementById('guidanceScaleInput').value;
|
230 |
const numInferenceSteps = document.getElementById('numInferenceStepsInput').value;
|
231 |
const seed = document.getElementById('seedInput').value;
|
232 |
-
const model = '
|
|
|
|
|
233 |
|
234 |
if (size === 'square'){
|
235 |
height = 1024;
|
@@ -261,6 +353,8 @@ async function generateImage(){
|
|
261 |
formData.append('width', width);
|
262 |
formData.append('guidance_scale', guidanceScale);
|
263 |
formData.append('num_inference_steps', numInferenceSteps);
|
|
|
|
|
264 |
if (seed > 0){
|
265 |
formData.append('seed', seed);
|
266 |
}
|
@@ -273,15 +367,16 @@ async function generateImage(){
|
|
273 |
const authToken = localStorage.getItem('authToken');
|
274 |
if (!authToken){
|
275 |
alert('Please enter your Deepinfra API token.');
|
276 |
-
|
277 |
}
|
278 |
return authToken;
|
279 |
}
|
280 |
|
281 |
-
|
|
|
282 |
method: 'POST',
|
283 |
headers: {
|
284 |
-
|
285 |
},
|
286 |
body: formData
|
287 |
};
|
@@ -293,14 +388,25 @@ async function generateImage(){
|
|
293 |
const data = await response.json();
|
294 |
loadingButton(false);
|
295 |
console.log("API response:",data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
|
297 |
if (data.output && data.output.length > 0) {
|
298 |
const imageElement = document.getElementById('generatedImage');
|
299 |
imageElement.src = data.output[0];
|
300 |
}
|
301 |
} catch (error) {
|
302 |
-
alert('There was an error while making the request. Check the console for more information.');
|
303 |
-
console.error('There was an error while making the request:', error);
|
|
|
304 |
}
|
305 |
}
|
306 |
</script>
|
|
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
|
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
6 |
+
<title>SDXL</title>
|
7 |
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
8 |
<!--Bootstrap -->
|
9 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.1/js/bootstrap.min.js" integrity="sha512-fHY2UiQlipUq0dEabSM4s+phmn+bcxSYzXP4vAXItBvBHU7zAM/mkhCZjtBEIJexhOMzZbgFlPLuErlJF2b+0g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
10 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.1/css/bootstrap.min.css" integrity="sha512-Z/def5z5u2aR89OuzYcxmDJ0Bnd5V1cKqBEbvLOiUNWdg9PQeXVvXLI90SE4QOHGlfLqUnDNVAYyZi8UwUTmWQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
11 |
+
<!-- Material Design Icons -->
|
12 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/MaterialDesign-Webfont/7.2.96/css/materialdesignicons.min.css" integrity="sha512-LX0YV/MWBEn2dwXCYgQHrpa9HJkwB+S+bnBpifSOTO1No27TqNMKYoAn6ff2FBh03THAzAiiCwQ+aPX+/Qt/Ow==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
13 |
+
|
14 |
+
<link rel="stylesheet" href="css/theme.css">
|
15 |
</head>
|
16 |
+
<body style="padding-inline: 0.8em;padding-block: 0.5em;">
|
17 |
<label for="promptInput" class="form-label">Prompt:</label>
|
18 |
+
<input type="text" id="promptInput" class="form-control" placeholder="Ex: pet" autocomplete="off">
|
19 |
<br>
|
20 |
<label for="negativePromptInput" class="form-label">Negative Prompt:</label>
|
21 |
+
<input type="text" id="negativePromptInput" class="form-control" placeholder="Ex: cat" autocomplete="off">
|
22 |
<br>
|
23 |
<div class="row">
|
24 |
<div class="col">
|
25 |
+
<label for="styleSelect" class="form-label">Artistic style:</label>
|
26 |
<select id="styleSelect" class="form-select">
|
27 |
</select>
|
28 |
</div>
|
|
|
43 |
<div class="accordion-item">
|
44 |
<h2 class="accordion-header">
|
45 |
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
|
46 |
+
Advanced Options
|
47 |
</button>
|
48 |
</h2>
|
49 |
<div id="flush-collapseOne" class="accordion-collapse collapse" data-bs-parent="#accordionFlushAdvancedOptions">
|
50 |
<br>
|
51 |
<!--Number of inference steps-->
|
52 |
<label for="numInferenceStepsInput" class="form-label">Number of inference steps:</label>
|
53 |
+
<input type="number" id="numInferenceStepsInput" class="form-control" value="20" placeholder="Number of inference steps" min="8" max="25">
|
54 |
<br>
|
55 |
<!--Guidance scale-->
|
56 |
<label for="guidanceScaleInput" class="form-label">Guidance Scale:</label>
|
|
|
60 |
<label for="seedInput" class="form-label">Seed:</label>
|
61 |
<input type="number" id="seedInput" class="form-control" value="0" placeholder="Seed" min="0">
|
62 |
<br>
|
63 |
+
<!--Refiner-->
|
64 |
+
<label for="refinerSelect" class="form-label">Refiner:</label>
|
65 |
+
<select id="refinerSelect" class="form-select">
|
66 |
+
<option value="no_refiner">No refiner</option>
|
67 |
+
<option value="expert_ensemble_refiner">Expert ensemble refiner</option>
|
68 |
+
<option value="base_image_refiner">Base image refiner</option>
|
69 |
+
</select>
|
70 |
+
<br>
|
71 |
+
<!--Sampler-->
|
72 |
+
<label for="samplerSelect" class="form-label">Sampler:</label>
|
73 |
+
<select id="samplerSelect" class="form-select">
|
74 |
+
<option value="DDIM">DDIM</option>
|
75 |
+
<option value="DPMSolverMultistep">DPMSolverMultistep</option>
|
76 |
+
<option value="HeunDiscrete">HeunDiscrete</option>
|
77 |
+
<option value="KarrasDPM">KarrasDPM</option>
|
78 |
+
<option value="K_EULER_ANCESTRAL">K_EULER_ANCESTRAL</option>
|
79 |
+
<option value="K_EULER">K_EULER</option>
|
80 |
+
<option value="PNDM">PNDM</option>
|
81 |
+
</select>
|
82 |
+
<br>
|
83 |
+
<!--Model-->
|
84 |
+
<label style="display: none;" for="modelSelect" class="form-label">Model:</label>
|
85 |
+
<select style="display: none;" id="modelSelect" class="form-select">
|
86 |
+
<option value="stability-ai/sdxl">stability-ai/sdxl</option>
|
87 |
+
</select>
|
88 |
<!--Deepinfra API token-->
|
89 |
<label for="authTokenInput" class="form-label">Deepinfra API token:</label>
|
90 |
<input type="password" id="authTokenInput" class="form-control" placeholder="Deepinfra API token">
|
|
|
92 |
</div>
|
93 |
</div>
|
94 |
<br>
|
95 |
+
<button id="generateButton" class="btn btn-outline">Generate image</button>
|
96 |
<br><br>
|
97 |
+
<div class="d-flex justify-content-center">
|
98 |
+
<img id="generatedImage" style="max-width: 90vw;" width="512" class="justify-content-center">
|
99 |
+
</div>
|
100 |
</body>
|
101 |
<script type="module">
|
102 |
|
103 |
+
const modelName = 'stability-ai/sdxl';
|
104 |
+
|
105 |
const stylesArray = [
|
106 |
{
|
107 |
name:'Default',
|
|
|
110 |
},
|
111 |
{
|
112 |
name:'Anime',
|
113 |
+
prompt: ',anime style, [manga], [illustration], [artwork], [anime wallpaper],[anime fanart], [detailed anime background], anime studio,',
|
114 |
+
negative_prompt: ',black and white,b&w, monochrome, 3d render, photography, photo, [cartoon], abstract art, poorly drawn, (text), (dialog bubble), (letters), [cartoon comics], [superhero comics], signature, [minimalist art], 3d model, amateur anime artist,canvas frame,bad art,ugly,nude,porn,naked,nsfw,hentai,'
|
115 |
+
},
|
116 |
+
{
|
117 |
+
name:'Anime - Studio Ghibli',
|
118 |
+
prompt: ',studio ghibli,[beautiful anime],',
|
119 |
+
negative_prompt: ',black and white,ugly,deformed,photo,3d render,abstract,noisy,blurry,poorly drawn,(text), (dialog bubble), (letters), [superhero comics],signature,amateur,nude,porn,naked,nsfw,hentai,'
|
120 |
+
},
|
121 |
+
{
|
122 |
+
name:'Realistic Anime',
|
123 |
+
prompt: ',realistic anime, realistic manga, [illustration], [artwork], realistic anime illumination, realistic anime shading, [realistic anime Deviantart], [realistic anime Artstation], [realistic anime wallpaper],[realistic anime fanart], [realistic anime Pinterest], realistic and detailed anime background, realistic anime shadows,',
|
124 |
negative_prompt: ',black and white,b&w, monochrome, 3d render, photography, photo, [cartoon], abstract art, poorly drawn, (text), (dialog bubble), (letters), [cartoon comics], [superhero comics], signature, [minimalist art], 3d model, amateur anime artist,canvas frame,bad art,ugly,nude,porn,naked,nsfw,hentai,'
|
125 |
},
|
126 |
{
|
|
|
128 |
prompt: ',sharp image, full hd, 1080p,4k, [8k] ,[uhd], high quality, detailed, high resolution, [high res],[RAW photo], [HDR], [hard shadows], [cinematic shot], [dramatic lighting], [soft lighting], [dslr], professional photographer,photorealistic, realistic,real,',
|
129 |
negative_prompt: ',blurry, low res, low resolution, low quality,ugly,nude,porn,naked,nsfw,hentai,'
|
130 |
},
|
131 |
+
{
|
132 |
+
name:'Realistic anatomy',
|
133 |
+
prompt: ',realistic anatomy,',
|
134 |
+
negative_prompt: ',amputee, deformed body, long neck, extra fingers, bad body proportions, mutated hands, mutilated, mutation, ugly, fused fingers, malformed limbs, extra heads, morbid, disfigured,'
|
135 |
+
},
|
136 |
{
|
137 |
name:'Renaissance',
|
138 |
prompt: ',renaissance painting style, [chiaroscuro],[detailed brushwork],[classical beauty],oil on canvas,[classical art],[historical art],oil painting,[fine details],[perspective],[masterpiece],[artwork style],[sharp image],[high resolution],[detailed],[professional style],[frescoes],',
|
139 |
negative_prompt: ',(black and white),sepia,blurry, low res, low resolution, low quality,ugly,artist painting,artist drawing,(digital painting style),3d render,photo,nude,porn,naked,nsfw,'
|
140 |
},
|
141 |
+
{
|
142 |
+
name:'Caravaggio',
|
143 |
+
prompt: ',Caravaggio,Italian Baroque style, [chiaroscuro],[dramatic composition],oil painting,Renaissance art,',
|
144 |
+
negative_prompt: ',nude,porn,naked,nsfw,'
|
145 |
+
},
|
146 |
{
|
147 |
name:'Impressionism',
|
148 |
prompt: ',impressionist painting style,[brushstrokes],[loose brushwork style],[natural light],[vibrant colors],[oil on canvas],',
|
|
|
160 |
},
|
161 |
{
|
162 |
name: "Art Nouveau",
|
163 |
+
prompt: ",Art Nouveau style,illustration,detailed,artwork,[vintage],[[realistic anatomy]],",
|
164 |
+
negative_prompt: ",nude,porn,naked,nsfw,[deformed],[morbid],[disfigured],noisy,abstract,visual glitch,low contrast,blurry,"
|
165 |
+
},
|
166 |
+
{
|
167 |
+
name: "Art Nouveau - Harrison Fisher",
|
168 |
+
prompt: ",[Harrison Fisher],[[Gilded Age aesthetics]],",
|
169 |
+
negative_prompt: ",nude,porn,naked,nsfw,[deformed],[morbid],[disfigured],"
|
170 |
},
|
171 |
{
|
172 |
name: "Faded Polaroid Photo",
|
173 |
prompt: ",Faded Polaroid Photo, analog, old faded photo, old polaroid,",
|
174 |
+
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast, vibrant, black and white,vibrant colors,"
|
175 |
},
|
176 |
{
|
177 |
name: "Japanese Ink Drawing",
|
178 |
+
prompt: ",Japanese Ink Drawing, ink drawing, inkwash, Japanese Ink Drawing,[masterpiece],[detailed],",
|
179 |
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast, colorful, vibrant,"
|
180 |
},
|
181 |
{
|
|
|
188 |
prompt: ",Vector Art Stickers, professional vector design, sticker designs, Sticker Sheet,",
|
189 |
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast,"
|
190 |
},
|
|
|
|
|
|
|
|
|
|
|
191 |
{
|
192 |
name: "Art Deco",
|
193 |
prompt: ",Art Deco, sleek, geometric forms, art deco style,",
|
|
|
196 |
{
|
197 |
name: "Flat 2D Art",
|
198 |
prompt: ",Flat 2D Art, simple flat color, 2-dimensional, Flat 2D Art Style,",
|
199 |
+
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast, 3D render, photo, realistic,"
|
200 |
},
|
201 |
{
|
202 |
name: "Baroque",
|
203 |
prompt: ",Baroque, dramatic, exuberant, grandeur, baroque art,",
|
204 |
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast,"
|
205 |
},
|
|
|
|
|
|
|
|
|
|
|
206 |
{
|
207 |
name: "Medievalism",
|
208 |
+
prompt: ",Medievalism, inspired by The Middle Ages, medieval art, [elaborate patterns and decoration], Medievalism,",
|
209 |
+
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast,modern,"
|
210 |
},
|
211 |
{
|
212 |
name: "Pencil Sketch Drawing",
|
213 |
+
prompt: ",Pencil Sketch Drawing style, black and white drawing, graphite drawing style,",
|
214 |
negative_prompt: ",ugly, deformed, noisy, blurry, low contrast,"
|
215 |
},
|
216 |
{
|
217 |
name: "3D Model",
|
218 |
+
prompt: ",professional 3d model,3d render, [octane render], highly detailed, [volumetric], [dramatic lighting],",
|
219 |
+
negative_prompt: ",illustration,photo,ugly, deformed, noisy, low poly, blurry, painting,"
|
220 |
},
|
221 |
{
|
222 |
name: "Analog Film",
|
|
|
236 |
{
|
237 |
name: "Pixel art",
|
238 |
prompt: ",pixel-art, low-res, blocky, pixel art style, 8-bit graphics,",
|
239 |
+
negative_prompt: ",3d render,sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic,"
|
240 |
+
},
|
241 |
+
{
|
242 |
+
name: "Watercolor",
|
243 |
+
prompt: ",watercolor painting, [vibrant], [beautiful], [painterly], [detailed], [textural], [artistic],",
|
244 |
+
negative_prompt: ",anime, photorealistic, photo, deformed, glitch, low contrast, noisy,ugly,3d render,photograph,blurry,low resolution,amateur,"
|
245 |
+
},
|
246 |
+
{
|
247 |
+
name: "Expressionist",
|
248 |
+
prompt: ",expressionist, [emotional], [dynamic], [distortion], [vibrant], [use of unusual colors], [detailed],",
|
249 |
+
negative_prompt: ",realism, symmetry, quiet, calm, ,anime, photorealistic, photo, deformed, glitch, low contrast, noisy,ugly,3d render,photograph,blurry,low resolution,amateur,"
|
250 |
+
},
|
251 |
+
{
|
252 |
+
name: "Vector",
|
253 |
+
prompt: ",vector art style,[flat],[svg],[adobe illustrator],",
|
254 |
+
negative_prompt: "3d render, photo, photorealistic, realistic cartoon, anime,"
|
255 |
+
},
|
256 |
+
{
|
257 |
+
name: "Greek sculpture",
|
258 |
+
prompt: ",greek sculpture,marble,",
|
259 |
+
negative_prompt: ",3d render, illustration,anime,painting,ugly,blurry,low resolution, low quality, amateur,"
|
260 |
+
},
|
261 |
+
{
|
262 |
+
name: "American Realism - Edward Hopper",
|
263 |
+
prompt: ",Edward Hopper,[oil paint],",
|
264 |
+
negative_prompt: ",3d render,anime,ugly,blurry,low resolution, low quality, amateur,photo,"
|
265 |
+
},
|
266 |
+
{
|
267 |
+
name: "American Realism",
|
268 |
+
prompt: ",American Realism,[oil paint],",
|
269 |
+
negative_prompt: ",3d render,anime,ugly,blurry,low resolution, low quality, amateur,photo,"
|
270 |
+
},
|
271 |
+
{
|
272 |
+
name: "Impasto",
|
273 |
+
prompt: ",impasto,[paint],",
|
274 |
+
negative_prompt: ",3d render,anime,ugly,blurry,low resolution, low quality, amateur,photo,abstract,"
|
275 |
+
},
|
276 |
+
{
|
277 |
+
name: "Roman Mosaic",
|
278 |
+
prompt: ",roman, mosaic,[art work],[detailed],",
|
279 |
+
negative_prompt: "dirt,ugly,paint,"
|
280 |
+
},
|
281 |
+
{
|
282 |
+
name: "Japanese traditional art",
|
283 |
+
prompt: ",Ukiyo-e,traditional Japanese art,woman,",
|
284 |
+
negative_prompt: ",anime,photo,digital,abstract,deformed,ugly,Katakana,Hiragana,Kanji,"
|
285 |
},
|
286 |
]
|
287 |
|
|
|
307 |
}
|
308 |
loadStyleSelect();
|
309 |
|
|
|
|
|
310 |
document.getElementById('generateButton').addEventListener('click', generateImage);
|
311 |
async function generateImage(){
|
312 |
const authTokenTemp = document.getElementById('authTokenInput').value;
|
|
|
319 |
const guidanceScale = document.getElementById('guidanceScaleInput').value;
|
320 |
const numInferenceSteps = document.getElementById('numInferenceStepsInput').value;
|
321 |
const seed = document.getElementById('seedInput').value;
|
322 |
+
const model = document.getElementById('modelSelect').value;
|
323 |
+
const refiner = document.getElementById('refinerSelect').value;
|
324 |
+
const sampler = document.getElementById('samplerSelect').value;
|
325 |
|
326 |
if (size === 'square'){
|
327 |
height = 1024;
|
|
|
353 |
formData.append('width', width);
|
354 |
formData.append('guidance_scale', guidanceScale);
|
355 |
formData.append('num_inference_steps', numInferenceSteps);
|
356 |
+
formData.append('refine', refiner);
|
357 |
+
formData.append('scheduler', sampler);
|
358 |
if (seed > 0){
|
359 |
formData.append('seed', seed);
|
360 |
}
|
|
|
367 |
const authToken = localStorage.getItem('authToken');
|
368 |
if (!authToken){
|
369 |
alert('Please enter your Deepinfra API token.');
|
370 |
+
return;
|
371 |
}
|
372 |
return authToken;
|
373 |
}
|
374 |
|
375 |
+
|
376 |
+
let requestOptions = {
|
377 |
method: 'POST',
|
378 |
headers: {
|
379 |
+
'Authorization': `bearer ${getAuthToken()}`,
|
380 |
},
|
381 |
body: formData
|
382 |
};
|
|
|
388 |
const data = await response.json();
|
389 |
loadingButton(false);
|
390 |
console.log("API response:",data);
|
391 |
+
|
392 |
+
if (data.detail === 'User is not authorized to access this resource'){
|
393 |
+
alert("User is not authorized to access the api service. Please check your Deepinfra API token.");
|
394 |
+
console.error(data.detail);
|
395 |
+
}
|
396 |
+
|
397 |
+
if (data.error === "NSFW content detected. Try running it again, or try a different prompt."){
|
398 |
+
alert("NSFW content detected. Try running it again, or try a different prompt.");
|
399 |
+
console.error("NSFW content detected. Try running it again, or try a different prompt.");
|
400 |
+
}
|
401 |
|
402 |
if (data.output && data.output.length > 0) {
|
403 |
const imageElement = document.getElementById('generatedImage');
|
404 |
imageElement.src = data.output[0];
|
405 |
}
|
406 |
} catch (error) {
|
407 |
+
alert('There was an error while making the api request. Make sure you have provided the deepinfra api key. Check the console for more information.');
|
408 |
+
console.error('There was an error while making the api request:', error);
|
409 |
+
loadingButton(false);
|
410 |
}
|
411 |
}
|
412 |
</script>
|