@@ -173,6 +173,8 @@ class RNGType(IntEnum):
173173# IPNDM,
174174# IPNDM_V,
175175# LCM,
176+ # DDIM_TRAILING,
177+ # TCD,
176178# N_SAMPLE_METHODS
177179# };
178180class SampleMethod (IntEnum ):
@@ -186,7 +188,9 @@ class SampleMethod(IntEnum):
186188 IPNDM = 7
187189 IPNDM_V = 8
188190 LCM = 9
189- N_SAMPLE_METHODS = 10
191+ DDIM_TRAILING = 10
192+ TCD = 11
193+ N_SAMPLE_METHODS = 12
190194
191195
192196# enum schedule_t {
@@ -210,43 +214,46 @@ class Schedule(IntEnum):
210214
211215# // same as enum ggml_type
212216# enum sd_type_t {
213- # SD_TYPE_F32 = 0,
214- # SD_TYPE_F16 = 1,
215- # SD_TYPE_Q4_0 = 2,
216- # SD_TYPE_Q4_1 = 3,
217+ # SD_TYPE_F32 = 0,
218+ # SD_TYPE_F16 = 1,
219+ # SD_TYPE_Q4_0 = 2,
220+ # SD_TYPE_Q4_1 = 3,
217221# // SD_TYPE_Q4_2 = 4, support has been removed
218222# // SD_TYPE_Q4_3 = 5, support has been removed
219- # SD_TYPE_Q5_0 = 6,
220- # SD_TYPE_Q5_1 = 7,
221- # SD_TYPE_Q8_0 = 8,
222- # SD_TYPE_Q8_1 = 9,
223- # SD_TYPE_Q2_K = 10,
224- # SD_TYPE_Q3_K = 11,
225- # SD_TYPE_Q4_K = 12,
226- # SD_TYPE_Q5_K = 13,
227- # SD_TYPE_Q6_K = 14,
228- # SD_TYPE_Q8_K = 15,
229- # SD_TYPE_IQ2_XXS = 16,
230- # SD_TYPE_IQ2_XS = 17,
231- # SD_TYPE_IQ3_XXS = 18,
232- # SD_TYPE_IQ1_S = 19,
233- # SD_TYPE_IQ4_NL = 20,
234- # SD_TYPE_IQ3_S = 21,
235- # SD_TYPE_IQ2_S = 22,
236- # SD_TYPE_IQ4_XS = 23,
237- # SD_TYPE_I8 = 24,
238- # SD_TYPE_I16 = 25,
239- # SD_TYPE_I32 = 26,
240- # SD_TYPE_I64 = 27,
241- # SD_TYPE_F64 = 28,
242- # SD_TYPE_IQ1_M = 29,
243- # SD_TYPE_BF16 = 30,
244- # SD_TYPE_Q4_0_4_4 = 31,
245- # SD_TYPE_Q4_0_4_8 = 32,
246- # SD_TYPE_Q4_0_8_8 = 33,
247- # SD_TYPE_TQ1_0 = 34,
248- # SD_TYPE_TQ2_0 = 35,
249- # SD_TYPE_COUNT,
223+ # SD_TYPE_Q5_0 = 6,
224+ # SD_TYPE_Q5_1 = 7,
225+ # SD_TYPE_Q8_0 = 8,
226+ # SD_TYPE_Q8_1 = 9,
227+ # SD_TYPE_Q2_K = 10,
228+ # SD_TYPE_Q3_K = 11,
229+ # SD_TYPE_Q4_K = 12,
230+ # SD_TYPE_Q5_K = 13,
231+ # SD_TYPE_Q6_K = 14,
232+ # SD_TYPE_Q8_K = 15,
233+ # SD_TYPE_IQ2_XXS = 16,
234+ # SD_TYPE_IQ2_XS = 17,
235+ # SD_TYPE_IQ3_XXS = 18,
236+ # SD_TYPE_IQ1_S = 19,
237+ # SD_TYPE_IQ4_NL = 20,
238+ # SD_TYPE_IQ3_S = 21,
239+ # SD_TYPE_IQ2_S = 22,
240+ # SD_TYPE_IQ4_XS = 23,
241+ # SD_TYPE_I8 = 24,
242+ # SD_TYPE_I16 = 25,
243+ # SD_TYPE_I32 = 26,
244+ # SD_TYPE_I64 = 27,
245+ # SD_TYPE_F64 = 28,
246+ # SD_TYPE_IQ1_M = 29,
247+ # SD_TYPE_BF16 = 30,
248+ # // SD_TYPE_Q4_0_4_4 = 31, support has been removed from gguf files
249+ # // SD_TYPE_Q4_0_4_8 = 32,
250+ # // SD_TYPE_Q4_0_8_8 = 33,
251+ # SD_TYPE_TQ1_0 = 34,
252+ # SD_TYPE_TQ2_0 = 35,
253+ # // SD_TYPE_IQ4_NL_4_4 = 36,
254+ # // SD_TYPE_IQ4_NL_4_8 = 37,
255+ # // SD_TYPE_IQ4_NL_8_8 = 38,
256+ # SD_TYPE_COUNT = 39,
250257# };
251258class GGMLType (IntEnum ):
252259 SD_TYPE_F32 = 0
@@ -281,12 +288,15 @@ class GGMLType(IntEnum):
281288 SD_TYPE_F64 = 28
282289 SD_TYPE_IQ1_M = 29
283290 SD_TYPE_BF16 = 30
284- SD_TYPE_Q4_0_4_4 = 31
285- SD_TYPE_Q4_0_4_8 = 32
286- SD_TYPE_Q4_0_8_8 = 33
291+ # SD_TYPE_Q4_0_4_4 = 31 # support has been removed from gguf files
292+ # SD_TYPE_Q4_0_4_8 = 32
293+ # SD_TYPE_Q4_0_8_8 = 33
287294 SD_TYPE_TQ1_0 = 34
288295 SD_TYPE_TQ2_0 = 35
289- SD_TYPE_COUNT = 36
296+ # SD_TYPE_IQ4_NL_4_4 = 36,
297+ # SD_TYPE_IQ4_NL_4_8 = 37,
298+ # SD_TYPE_IQ4_NL_8_8 = 38,
299+ SD_TYPE_COUNT = 39
290300
291301
292302# ==================================
@@ -387,7 +397,7 @@ class sd_image_t(ctypes.Structure):
387397# ------------ txt2img ------------
388398
389399
390- # SD_API sd_image_t* txt2img(sd_ctx_t* sd_ctx, const char* prompt, const char* negative_prompt, int clip_skip, float cfg_scale, float guidance, int width, int height, enum sample_method_t sample_method, int sample_steps, int64_t seed, int batch_count, const sd_image_t* control_cond, float control_strength, float style_strength, bool normalize_input, const char* input_id_images_path, int* skip_layers, size_t skip_layers_count, float slg_scale, float skip_layer_start, float skip_layer_end);
400+ # SD_API sd_image_t* txt2img(sd_ctx_t* sd_ctx, const char* prompt, const char* negative_prompt, int clip_skip, float cfg_scale, float guidance, float eta, int width, int height, enum sample_method_t sample_method, int sample_steps, int64_t seed, int batch_count, const sd_image_t* control_cond, float control_strength, float style_strength, bool normalize_input, const char* input_id_images_path, int* skip_layers, size_t skip_layers_count, float slg_scale, float skip_layer_start, float skip_layer_end);
391401@ctypes_function (
392402 "txt2img" ,
393403 [
@@ -397,6 +407,7 @@ class sd_image_t(ctypes.Structure):
397407 ctypes .c_int , # clip_skip
398408 ctypes .c_float , # cfg_scale
399409 ctypes .c_float , # guidance
410+ ctypes .c_float , # eta
400411 ctypes .c_int , # width
401412 ctypes .c_int , # height
402413 ctypes .c_int , # sample_method
@@ -423,6 +434,7 @@ def txt2img(
423434 clip_skip : int ,
424435 cfg_scale : float ,
425436 guidance : float ,
437+ eta : float ,
426438 width : int ,
427439 height : int ,
428440 sample_method : int , # SampleMethod
@@ -446,18 +458,19 @@ def txt2img(
446458# ------------ img2img ------------
447459
448460
449- # SD_API sd_image_t* img2img(sd_ctx_t* sd_ctx, sd_image_t init_image, sd_image_t mask_image, const char* prompt, const char* negative_prompt, int clip_skip, float cfg_scale, float guidance, int width, int height, enum sample_method_t sample_method, int sample_steps, float strength, int64_t seed, int batch_count, const sd_image_t* control_cond, float control_strength, float style_strength, bool normalize_input, const char* input_id_images_path, int* skip_layers, size_t skip_layers_count, float slg_scale, float skip_layer_start, float skip_layer_end);
461+ # SD_API sd_image_t* img2img(sd_ctx_t* sd_ctx, sd_image_t init_image, sd_image_t mask_image, const char* prompt, const char* negative_prompt, int clip_skip, float cfg_scale, float guidance, float eta, int width, int height, enum sample_method_t sample_method, int sample_steps, float strength, int64_t seed, int batch_count, const sd_image_t* control_cond, float control_strength, float style_strength, bool normalize_input, const char* input_id_images_path, int* skip_layers, size_t skip_layers_count, float slg_scale, float skip_layer_start, float skip_layer_end);
450462@ctypes_function (
451463 "img2img" ,
452464 [
453465 sd_ctx_t_p_ctypes , # sd_ctx
454466 sd_image_t , # init_image
455- sd_image_t , # mask_image
467+ sd_image_t , # mask_image
456468 ctypes .c_char_p , # prompt
457469 ctypes .c_char_p , # negative_prompt
458470 ctypes .c_int , # clip_skip
459471 ctypes .c_float , # cfg_scale
460472 ctypes .c_float , # guidance
473+ ctypes .c_float , # eta
461474 ctypes .c_int , # width
462475 ctypes .c_int , # height
463476 ctypes .c_int , # sample_method
@@ -487,6 +500,7 @@ def img2img(
487500 clip_skip : int ,
488501 cfg_scale : float ,
489502 guidance : float ,
503+ eta : float ,
490504 width : int ,
491505 height : int ,
492506 sample_method : int , # SampleMethod
0 commit comments