Spaces:
Running
Running
imseldrith
commited on
Commit
·
391a49d
1
Parent(s):
c3fb706
Update templates/api_docs.html
Browse files- templates/api_docs.html +71 -14
templates/api_docs.html
CHANGED
@@ -47,6 +47,17 @@
|
|
47 |
margin: 0;
|
48 |
overflow-x: auto;
|
49 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
</style>
|
51 |
<script>
|
52 |
document.addEventListener("DOMContentLoaded", function() {
|
@@ -111,24 +122,70 @@ payload = {
|
|
111 |
'model': 'REALISTIC'
|
112 |
}
|
113 |
|
114 |
-
response = requests.post(url, json=payload)
|
|
|
115 |
|
116 |
-
|
117 |
-
# Image generation successful
|
118 |
-
with open('generated_image.jpg', 'wb') as image_file:
|
119 |
-
image_file.write(response.content)
|
120 |
-
print('Image saved successfully!')
|
121 |
-
else:
|
122 |
-
# Error occurred during image generation
|
123 |
-
error_data = response.json()
|
124 |
-
error_message = error_data.get('error', 'Unknown error')
|
125 |
-
print(f'Failed to generate image: {error_message}')
|
126 |
</pre>
|
127 |
</div>
|
128 |
</div>
|
129 |
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
</body>
|
133 |
-
</html>
|
134 |
-
|
|
|
47 |
margin: 0;
|
48 |
overflow-x: auto;
|
49 |
}
|
50 |
+
|
51 |
+
.image-style {
|
52 |
+
width: 100px;
|
53 |
+
height: auto;
|
54 |
+
}
|
55 |
+
|
56 |
+
.style-info {
|
57 |
+
margin-top: 10px;
|
58 |
+
font-size: 0.8em;
|
59 |
+
color: #888;
|
60 |
+
}
|
61 |
</style>
|
62 |
<script>
|
63 |
document.addEventListener("DOMContentLoaded", function() {
|
|
|
122 |
'model': 'REALISTIC'
|
123 |
}
|
124 |
|
125 |
+
response = requests.post(url, headers=headers, json=payload)
|
126 |
+
result = response.json()
|
127 |
|
128 |
+
print(result['error']) # An error occurred while generating the image.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
</pre>
|
130 |
</div>
|
131 |
</div>
|
132 |
|
133 |
+
<div class="endpoint">
|
134 |
+
<h3>Supported Ratios</h3>
|
135 |
+
<div class="style-info">
|
136 |
+
<p><strong>RATIO_1X1:</strong> 1:1</p>
|
137 |
+
<p><strong>RATIO_4X3:</strong> 4:3</p>
|
138 |
+
<p><strong>RATIO_3X2:</strong> 3:2</p>
|
139 |
+
<p><strong>RATIO_2X3:</strong> 2:3</p>
|
140 |
+
<p><strong>RATIO_16X9:</strong> 16:9</p>
|
141 |
+
<p><strong>RATIO_9X16:</strong> 9:16</p>
|
142 |
+
<p><strong>RATIO_5X4:</strong> 5:4</p>
|
143 |
+
<p><strong>RATIO_4X5:</strong> 4:5</p>
|
144 |
+
<p><strong>RATIO_3X1:</strong> 3:1</p>
|
145 |
+
<p><strong>RATIO_3X4:</strong> 3:4</p>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
<div class="endpoint">
|
150 |
+
<h3>Supported Models</h3>
|
151 |
+
<div class="style-info">
|
152 |
+
<p><strong>V4_BETA:</strong> V4(Beta)</p>
|
153 |
+
<p><strong>CREATIVE:</strong> Creative</p>
|
154 |
+
<p><strong>V3:</strong> V3</p>
|
155 |
+
<p><strong>V1:</strong> V1</p>
|
156 |
+
<p><strong>PORTRAIT:</strong> Portrait</p>
|
157 |
+
<p><strong>REALISTIC:</strong> Realistic</p>
|
158 |
+
<p><strong>ANIME:</strong> Anime</p>
|
159 |
+
</div>
|
160 |
+
</div>
|
161 |
|
162 |
+
<div class="endpoint">
|
163 |
+
<h3>Supported Styles</h3>
|
164 |
+
<div class="style-info">
|
165 |
+
<p><strong>NO_STYLE:</strong> No style</p>
|
166 |
+
<p><strong>EUPHORIC:</strong> Euphoric</p>
|
167 |
+
<p><strong>FANTASY:</strong> Fantasy</p>
|
168 |
+
<p><strong>CYBERPUNK:</strong> Cyberpunk</p>
|
169 |
+
<p><strong>STUDIO_GHIBLI:</strong> Studio Ghibli</p>
|
170 |
+
<p><strong>DISNEY:</strong> Disney</p>
|
171 |
+
<p><strong>GTA:</strong> GTA</p>
|
172 |
+
<p><strong>KAWAII_CHIBI:</strong> Kawaii Chibi</p>
|
173 |
+
<p><strong>ANIME_V2:</strong> Anime V2</p>
|
174 |
+
<p><strong>ABSTRACT_VIBRANT:</strong> Abstract Vibrant</p>
|
175 |
+
<p><strong>VIBRANT:</strong> Vibrant</p>
|
176 |
+
<p><strong>PSYCHEDELIC:</strong> Psychedelic</p>
|
177 |
+
<p><strong>EXTRA_TERRESTRIAL:</strong> Extra-terrestrial</p>
|
178 |
+
<p><strong>COSMIC:</strong> Cosmic</p>
|
179 |
+
<p><strong>MACRO_PHOTOGRAPHY:</strong> Macro Photography</p>
|
180 |
+
<p><strong>PRODUCT_PHOTOGRAPHY:</strong> Product Photography</p>
|
181 |
+
<p><strong>POLAROID:</strong> Polaroid</p>
|
182 |
+
<p><strong>NEO_FAUVISM:</strong> Neo fauvism</p>
|
183 |
+
<p><strong>POP_ART:</strong> Pop Art</p>
|
184 |
+
<p><strong>POP_ART_II:</strong> Pop Art II</p>
|
185 |
+
<p><strong>GRAFFITI:</strong> Graffiti</p>
|
186 |
+
<p><strong>SURREALISM:</strong> Surrealism</p>
|
187 |
+
<p><strong>BAUHAUS:</strong> Bauhaus</p>
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
</body>
|
191 |
+
</html>
|
|