@@ -26,9 +26,9 @@ const getStableDiffusionDefaultInputFromPrompt = (prompt: string) => ({
26
26
] ,
27
27
28
28
model : "stable-diffusion-xl-beta-v2-2-2" ,
29
+ sampler : { id : "0" , name : "DDIM" } ,
29
30
style : "enhance" ,
30
31
31
- sampler : { value : 0 , name : "DDIM" } ,
32
32
width : 512 ,
33
33
height : 512 ,
34
34
@@ -147,6 +147,8 @@ export const createPlugin = StableStudio.createPlugin<{
147
147
) ;
148
148
}
149
149
150
+ console . log ( input . sampler . id ? parseInt ( input . sampler . id ) : 0 ) ;
151
+
150
152
const imageParams = Generation . ImageParameters . create ( {
151
153
width : BigInt ( width ) ,
152
154
height : BigInt ( height ) ,
@@ -158,7 +160,7 @@ export const createPlugin = StableStudio.createPlugin<{
158
160
transform : Generation . TransformType . create ( {
159
161
type : {
160
162
oneofKind : "diffusion" ,
161
- diffusion : input . sampler . value ?? 0 ,
163
+ diffusion : input . sampler . id ? parseInt ( input . sampler . id ) : 0 ,
162
164
} ,
163
165
} ) ,
164
166
@@ -411,55 +413,6 @@ export const createPlugin = StableStudio.createPlugin<{
411
413
) ;
412
414
} ,
413
415
414
- getStableDiffusionSamplers : ( ) => {
415
- return [
416
- {
417
- value : 0 ,
418
- name : "DDIM" ,
419
- } ,
420
- {
421
- value : 1 ,
422
- name : "DDPM" ,
423
- } ,
424
- {
425
- value : 2 ,
426
- name : "K_EULER" ,
427
- } ,
428
- {
429
- value : 3 ,
430
- name : "K_EULER_ANCESTRAL" ,
431
- } ,
432
- {
433
- value : 4 ,
434
- name : "K_HEUN" ,
435
- } ,
436
- {
437
- value : 5 ,
438
- name : "K_DPM_2" ,
439
- } ,
440
- {
441
- value : 6 ,
442
- name : "K_DPM_2_ANCESTRAL" ,
443
- } ,
444
- {
445
- value : 7 ,
446
- name : "K_LMS" ,
447
- } ,
448
- {
449
- value : 8 ,
450
- name : "K_DPMPP_2S_ANCESTRAL" ,
451
- } ,
452
- {
453
- value : 9 ,
454
- name : "K_DPMPP_2M" ,
455
- } ,
456
- {
457
- value : 10 ,
458
- name : "K_DPMPP_SDE" ,
459
- } ,
460
- ] ;
461
- } ,
462
-
463
416
getStableDiffusionModels : async ( ) => {
464
417
const request = await engines . listEngines ( { } ) ;
465
418
const allEngines = await request . response . engine ;
@@ -484,6 +437,20 @@ export const createPlugin = StableStudio.createPlugin<{
484
437
localStorage . getItem ( "stability-apiKey" ) ?? undefined
485
438
) ,
486
439
440
+ getStableDiffusionSamplers : ( ) => [
441
+ { id : "0" , name : "DDIM" } ,
442
+ { id : "1" , name : "DDPM" } ,
443
+ { id : "2" , name : "K_EULER" } ,
444
+ { id : "3" , name : "K_EULER_ANCESTRAL" } ,
445
+ { id : "4" , name : "K_HEUN" } ,
446
+ { id : "5" , name : "K_DPM_2" } ,
447
+ { id : "6" , name : "K_DPM_2_ANCESTRAL" } ,
448
+ { id : "7" , name : "K_LMS" } ,
449
+ { id : "8" , name : "K_DPMPP_2S_ANCESTRAL" } ,
450
+ { id : "9" , name : "K_DPMPP_2M" } ,
451
+ { id : "10" , name : "K_DPMPP_SDE" } ,
452
+ ] ,
453
+
487
454
getStableDiffusionStyles : ( ) => [
488
455
{
489
456
id : "enhance" ,
0 commit comments