Add guided FLUX Klein component setup and tested image pipeline
This commit is contained in:
@@ -6,15 +6,15 @@ import folder_paths
|
||||
class DeckTextEncoderLoader:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {'required':{'clip_name':(folder_paths.get_filename_list('text_encoders'),)}}
|
||||
return {'required':{'clip_name':(folder_paths.get_filename_list('text_encoders'),)},'optional':{'family':(['qwen_image','flux2'],)}}
|
||||
RETURN_TYPES=('CLIP',)
|
||||
FUNCTION='load_clip'
|
||||
CATEGORY='Deck'
|
||||
def load_clip(self,clip_name):
|
||||
def load_clip(self,clip_name,family="qwen_image"):
|
||||
if torch.cuda.device_count()!=2:raise RuntimeError('Deck requires the two reserved GPUs.')
|
||||
device=torch.device('cuda:1')
|
||||
path=folder_paths.get_full_path_or_raise('text_encoders',clip_name)
|
||||
clip=comfy.sd.load_clip(ckpt_paths=[path],embedding_directory=folder_paths.get_folder_paths('embeddings'),clip_type=comfy.sd.CLIPType.QWEN_IMAGE,
|
||||
clip=comfy.sd.load_clip(ckpt_paths=[path],embedding_directory=folder_paths.get_folder_paths('embeddings'),clip_type=comfy.sd.CLIPType.FLUX2 if family=='flux2' else comfy.sd.CLIPType.QWEN_IMAGE,
|
||||
model_options={'load_device':device,'offload_device':torch.device('cpu'),'initial_device':torch.device('cpu')})
|
||||
if clip.patcher.load_device!=device:raise RuntimeError('Textencoder could not be assigned to the reserved GPU.')
|
||||
return (clip,)
|
||||
|
||||
Reference in New Issue
Block a user