|
25 | 25 | <div class="d-flex flex-fill"> |
26 | 26 |
|
27 | 27 | @* Controls *@ |
28 | | - <div class="d-flex flex-column w-100 me-2 p-2 border border-1 border-dark" style="max-width:500px;overflow:hidden"> |
| 28 | + <div class="d-flex flex-column w-100 me-2 p-2 border border-1 border-dark" style="max-width:440px;overflow:hidden"> |
29 | 29 |
|
30 | 30 | <h4 class="pb-0 mb-0">Text To Image</h4> |
31 | 31 | <small>Text to image transforms textual descriptions into visual content</small> |
|
40 | 40 | <div class="d-flex flex-column flex-grow-0 gap-2 p-1 w-100"> |
41 | 41 | <div class="d-flex flex-column"> |
42 | 42 | <small>Prompt</small> |
43 | | - @Html.TextAreaFor(m => m.Options.Prompt, new { @class = "form-control form-control-sm p-1", @rows = 3 }) |
44 | | - @Html.ValidationMessageFor(m => m.Options.Prompt, "", new { @class = "text-danger" }) |
| 43 | + @Html.TextAreaFor(m => m.Prompt.Prompt, new { @class = "form-control form-control-sm p-1", @rows = 3 }) |
| 44 | + @Html.ValidationMessageFor(m => m.Prompt.Prompt, "", new { @class = "text-danger" }) |
45 | 45 | </div> |
46 | 46 | <div class="d-flex flex-column"> |
47 | 47 | <small>Negative Prompt</small> |
48 | | - @Html.TextAreaFor(m => m.Options.NegativePrompt, new { @class = "form-control form-control-sm", @rows = 3 }) |
49 | | - @Html.ValidationMessageFor(m => m.Options.NegativePrompt, "", new { @class = "text-danger" }) |
| 48 | + @Html.TextAreaFor(m => m.Prompt.NegativePrompt, new { @class = "form-control form-control-sm", @rows = 2 }) |
| 49 | + @Html.ValidationMessageFor(m => m.Prompt.NegativePrompt, "", new { @class = "text-danger" }) |
50 | 50 | </div> |
51 | 51 | </div> |
52 | 52 |
|
|
72 | 72 | <div class="d-flex flex-row gap-2"> |
73 | 73 | <div class="w-100"> |
74 | 74 | <small>Scheduler</small> |
75 | | - @Html.DropDownListFor( m => m.Options.SchedulerType,Html.GetEnumSelectList<SchedulerType>(), new { @class = "form-control form-select-sm"}) |
| 75 | + @Html.DropDownListFor( m => m.Prompt.SchedulerType,Html.GetEnumSelectList<SchedulerType>(), new { @class = "form-control form-select-sm"}) |
76 | 76 | </div> |
77 | | - <div class="w-75"> |
| 77 | + <div class="w-100"> |
| 78 | + <small>Seed <i>(0 = Random)</i></small> |
| 79 | + @Html.TextBoxFor( m => m.Options.Seed, new { @class = "form-control form-control-sm"}) |
| 80 | + </div> |
| 81 | + <div class="w-50"> |
78 | 82 | <small>Width</small> |
79 | 83 | @Html.DropDownListFor( m => m.Options.Width, new SelectList(ValidSizes), new { @class = "form-control form-select-sm"}) |
80 | 84 | </div> |
81 | | - <div class="w-75"> |
| 85 | + <div class="w-50"> |
82 | 86 | <small>Height</small> |
83 | 87 | @Html.DropDownListFor( m => m.Options.Height, new SelectList(ValidSizes), new { @class = "form-control form-select-sm"}) |
84 | 88 | </div> |
85 | | - <div class="w-100"> |
86 | | - <small>Seed <i>(0 = Random)</i></small> |
87 | | - @Html.TextBoxFor( m => m.Options.Seed, new { @class = "form-control form-control-sm"}) |
88 | | - </div> |
| 89 | + |
89 | 90 | </div> |
90 | 91 |
|
91 | 92 | <div class="d-flex flex-row gap-2"> |
|
128 | 129 | <div class="w-100"> |
129 | 130 | <div class="d-flex flex-row align-items-center mt-3"> |
130 | 131 | <input type="checkbox" asp-for="@Model.Options.UseKarrasSigmas" /> |
131 | | - <small class="ms-1">UseKarrasSigmas</small> |
| 132 | + <small class="ms-1">Karras Sigmas</small> |
132 | 133 | </div> |
133 | 134 | </div> |
134 | 135 |
|
135 | 136 | </div> |
136 | 137 |
|
137 | 138 | <div class="d-flex flex-row align-items-center gap-2"> |
138 | 139 | <div class="w-100"> |
139 | | - <small>BetaScheduleType</small> |
| 140 | + <small>BetaSchedule</small> |
140 | 141 | @Html.DropDownListFor( m => m.Options.BetaSchedule, Html.GetEnumSelectList<BetaScheduleType>(), new { @class = "form-control form-select-sm"}) |
141 | 142 | </div> |
142 | 143 | <div class="w-100"> |
|
156 | 157 | <div class="d-flex flex-row align-items-center gap-2"> |
157 | 158 |
|
158 | 159 | <div class="w-100"> |
159 | | - <small>VarianceType</small> |
| 160 | + <small>Variance</small> |
160 | 161 | @Html.DropDownListFor( m => m.Options.VarianceType, Html.GetEnumSelectList<VarianceType>(), new { @class = "form-control form-select-sm"}) |
161 | 162 | </div> |
162 | 163 | <div class="w-100"> |
163 | | - <small>PredictionType</small> |
| 164 | + <small>Prediction</small> |
164 | 165 | @Html.DropDownListFor( m => m.Options.PredictionType, Html.GetEnumSelectList<PredictionType>(), new { @class = "form-control form-select-sm"}) |
165 | 166 | </div> |
166 | 167 | <div class="w-100"> |
167 | | - <small>AlphaTransformType</small> |
| 168 | + <small>AlphaTransform</small> |
168 | 169 | @Html.DropDownListFor( m => m.Options.AlphaTransformType, Html.GetEnumSelectList<AlphaTransformType>(), new { @class = "form-control form-select-sm"}) |
169 | 170 | </div> |
170 | 171 | <div class="w-100"> |
|
199 | 200 |
|
200 | 201 | <div class="d-flex flex-column flex-grow-0 w-100"> |
201 | 202 | <div class="d-flex flex-row gap-2 justify-content-between" autocomplete="off"> |
202 | | - <div class="d-flex flex-column justify-content-end w-50"> |
| 203 | + <div class="d-flex flex-column justify-content-end w-75"> |
203 | 204 | <div class="d-flex flex-row gap-2"> |
204 | 205 | <button type="button" class="btn-cancel btn btn-warning w-100" disabled>Cancel</button> |
205 | 206 | <button id="btn-txt2img-execute" type="button" class="btn btn-success w-100">Generate</button> |
|
223 | 224 | </div> |
224 | 225 |
|
225 | 226 | </div> |
226 | | - |
227 | | - |
228 | | - |
229 | | - |
230 | | - |
231 | | - |
232 | | - |
233 | | - |
234 | | - |
235 | | - |
236 | | - |
237 | | - |
238 | | - |
239 | | - |
240 | | - |
241 | | - |
242 | | - |
243 | | - |
244 | | - |
245 | | - |
246 | | - |
247 | | - |
248 | 227 | </form> |
249 | 228 |
|
250 | | - |
251 | 229 | </div> |
252 | 230 | </div> |
253 | 231 |
|
|
281 | 259 | <script id="outputResultTemplate" type="text/html"> |
282 | 260 | <div class="d-flex flex-column border border-1 border-dark p-1" style="min-width:256px;"> |
283 | 261 | <div style="overflow:hidden;text-align:center"> |
284 | | - <img id="img-result" width="{{width}}" height="{{height}}" src="{{outputImageUrl}}" /> |
| 262 | + <img id="img-result" width="{{width}}" height="{{height}}" src="{{imageUrl}}" alt="{{imageName}}"/> |
285 | 263 | </div> |
286 | 264 | <div class="d-flex flex-row flex-wrap-reverse justify-content-around pt-2" style="max-width:{{width}}px"> |
287 | 265 | <div class="d-flex flex-row align-items-center"> |
288 | 266 | <small class="result-info">Scheduler:</small> |
289 | | - <span>{{outputOptions.schedulerType}}</span> |
| 267 | + <span>{{blueprint.prompt.schedulerType}}</span> |
290 | 268 | </div> |
291 | 269 | <div class="d-flex flex-row align-items-center"> |
292 | 270 | <small class="result-info">Steps:</small> |
293 | | - <span>{{outputOptions.inferenceSteps}}</span> |
| 271 | + <span>{{blueprint.options.inferenceSteps}}</span> |
294 | 272 | </div> |
295 | 273 | <div class="d-flex flex-row align-items-center"> |
296 | 274 | <small class="result-info">Guidance:</small> |
297 | | - <span>{{outputOptions.guidanceScale}}</span> |
| 275 | + <span>{{blueprint.options.guidanceScale}}</span> |
298 | 276 | </div> |
299 | 277 | <div class="d-flex flex-row align-items-center"> |
300 | 278 | <small class="result-info">Seed:</small> |
301 | | - <span>{{outputOptions.seed}}</span> |
| 279 | + <span>{{blueprint.options.seed}}</span> |
302 | 280 | </div> |
303 | 281 | <div class="d-flex flex-row align-items-center"> |
304 | 282 | <small class="result-info">Elapsed:</small> |
|
307 | 285 | </div> |
308 | 286 | <div class="d-flex flex-row gap-2 pt-2"> |
309 | 287 | <div class="btn-group dropend w-100"> |
310 | | - <a class="btn btn-sm btn-success w-100" href="{{outputImageUrl}}" download="{{outputImage}}">Download</a> |
| 288 | + <a class="btn btn-sm btn-success w-100" href="{{imageUrl}}" download="{{imageName}}">Download</a> |
311 | 289 | <button type="button" class="btn btn-sm btn-success dropdown-toggle dropdown-toggle-split w-25" data-bs-toggle="dropdown" aria-expanded="false"> |
312 | 290 | </button> |
313 | 291 | <ul class="dropdown-menu"> |
314 | | - <li><a class="dropdown-item" href="{{outputImageUrl}}" download="{{outputImage}}">Download PNG</a></li> |
315 | | - <li><a class="dropdown-item" href="{{outputOptionsUrl}}" download="{{OutputOptions}}">Download JSON</a></li> |
| 292 | + <li><a class="dropdown-item" href="{{imageUrl}}" download="{{imageName}}">Download PNG</a></li> |
| 293 | + <li><a class="dropdown-item" href="{{blueprintUrl}}" download="{{blueprintName}}">Download JSON</a></li> |
316 | 294 | </ul> |
317 | 295 | </div> |
318 | 296 | <button type="button" class="btn btn-sm btn-info w-100" disabled>Image To Image</button> |
|
339 | 317 | const onResponse = (response) => { |
340 | 318 | if (!response) |
341 | 319 | return; |
342 | | -
|
343 | | - console.log(response); |
| 320 | + console.log(response) |
344 | 321 | updateResultImage(response); |
345 | 322 | processEnd(); |
346 | 323 | } |
|
354 | 331 | } |
355 | 332 |
|
356 | 333 | const onProgress = (response) => { |
357 | | - console.log(response); |
358 | 334 | updateProgress(response); |
359 | 335 | } |
360 | 336 |
|
361 | 337 | const onCanceled = (response) => { |
362 | | - console.log(response); |
363 | 338 | updatePlaceholderImage(); |
364 | 339 | processEnd(); |
365 | 340 | } |
|
372 | 347 | processBegin(); |
373 | 348 | updatePlaceholderImage(); |
374 | 349 | diffusionProcess = await connection |
375 | | - .stream("ExecuteTextToImage", diffusionParams) |
| 350 | + .stream("ExecuteTextToImage", diffusionParams, diffusionParams) //TODO: split params |
376 | 351 | .subscribe({ |
377 | 352 | next: onResponse, |
378 | 353 | complete: onResponse, |
|
0 commit comments