1111import torch
1212
1313
14- class DrawThingsWrapper :
14+ class DrawThingsTxt2Img :
1515 def __init__ (self ):
1616 pass
1717
@@ -21,11 +21,13 @@ def __init__(self):
2121 def INPUT_TYPES (cls ):
2222 return {
2323 "required" : {
24+ "model" : ("STRING" , {"default" : "flux_1_dev_q8p.ckpt" }),
2425 "prompt" : ("STRING" , {"default" : "" }),
2526 "seed" : ("INT" , {"default" : 42 }),
2627 "width" : ("INT" , {"default" : 512 }),
2728 "height" : ("INT" , {"default" : 512 }),
2829 "guidance_scale" : ("FLOAT" , {"default" : 3.5 }),
30+ "sampler" : (["UniPC" ,"DPM++ 2M Karras" ,"Euler Ancestral" , "DPM++ SDE Karras" , "PLMS" , "DDIM" , "LCM" , "Euler A Substep" , "DPM++ SDE Substep" , "TCD" , "DPM++ 2M Trailing" , "Euler A Trailing" , "DPM++ SDE Trailing" , "DDIM Trailing" , "DPM++ 2M AYS" , "Euler A AYS" , "DPM++ SDE AYS" ], {"default" : "Euler A Trailing" }),
2931 "steps" : ("INT" , {"default" : 20 }),
3032 }
3133 }
@@ -34,16 +36,18 @@ def INPUT_TYPES(cls):
3436 RETURN_NAMES = ("generated_image" ,)
3537 FUNCTION = "generate_image"
3638
37- def generate_image (self , prompt , seed , width , height , guidance_scale , steps ):
39+ def generate_image (self , model , prompt , seed , width , height , guidance_scale , sampler , steps ):
3840 # Call the Draw Things API
3941 api_url = "http://127.0.0.1:7860/sdapi/v1/txt2img"
4042
4143 payload = {
44+ "model" : model ,
4245 "prompt" : prompt ,
4346 "seed" : seed ,
4447 "width" : width ,
4548 "height" : height ,
4649 "guidance_scale" : guidance_scale ,
50+ "sampler" : sampler ,
4751 "steps" : steps ,
4852 }
4953
@@ -68,6 +72,6 @@ def generate_image(self, prompt, seed, width, height, guidance_scale, steps):
6872 return (torch .stack (images ),)
6973
7074
71- NODE_CLASS_MAPPINGS = {"DrawThingsWrapper " : DrawThingsWrapper }
75+ NODE_CLASS_MAPPINGS = {"DrawThingsTxt2Img " : DrawThingsTxt2Img }
7276
73- NODE_DISPLAY_NAME_MAPPINGS = {"DrawThingsWrapper " : "Draw Things Wrapper " }
77+ NODE_DISPLAY_NAME_MAPPINGS = {"DrawThingsTxt2Img " : "Draw Things Txt2Img " }
0 commit comments