From a51ca8b73e3bddcada94975df91d7ce5e5180bd4 Mon Sep 17 00:00:00 2001 From: WAS Date: Wed, 17 May 2023 13:23:07 -0700 Subject: [PATCH] Update how CLIP models are handled --- do_run.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/do_run.py b/do_run.py index 01aab90..1d3d96b 100644 --- a/do_run.py +++ b/do_run.py @@ -338,16 +338,18 @@ def run_one_frame(diffusion, model, clip_model, clip_vision, args, batchNum, fra image_prompt = [] device = comfy.model_management.get_torch_device() - - if isinstance(clip_vision, ClipVisionModel): - clip_vision.model.to(device) # Gets loaded to CPU by comfy, move to GPU - + print(f'Frame {frame_num} Prompt: {frame_prompt}') - clip_models = [clip_model] + clip_models = clip_model model_stats = [] for clip_model in clip_models: + + clip_vision = clip_model + if isinstance(clip_model, ClipVisionModel): + clip_vision = clip_model.model.to(device) # Gets loaded to CPU by comfy, move to GPU + cutn = args.cutn model_stat = {"clip_model": None, "target_embeds": [], "make_cutouts": None, "weights": []}