d8ahazard / sd_smartprocess

Smart Pre-processing extension for Stable Diffusion
191 stars 19 forks source link

TypeError when Append Flavor tags from CLIP is checked #10

Closed spog666 closed 1 year ago

spog666 commented 1 year ago

Traceback (most recent call last): File "D:\Stable Diffusion\stable-diffusion-webui\extensions\sd_smartprocess\smartprocess.py", line 325, in preprocess full_caption = build_caption(img) if caption else None File "D:\Stable Diffusion\stable-diffusion-webui\extensions\sd_smartprocess\smartprocess.py", line 134, in build_caption tags = clip_interrogator.interrogate(img, max_flavors=clip_max_flavors) File "D:\Stable Diffusion\stable-diffusion-webui\extensions\sdsmartprocess\clipinterrogator.py", line 221, in interrogate for in tqdm(range(max_flavors), desc="Flavor chain", disable=self.config.quiet): TypeError: 'float' object cannot be interpreted as an integer

Zyin055 commented 1 year ago

Using the extension for the first time. Checking "Append Flavor tags from CLIP" "4" causes the above error.

FKFoto commented 1 year ago

temporary fix which worked for me: change the line in clipinterrogator.py from 221 for _ in tqdm(range(max_flavors), desc="Flavor chain", disable=self.config.quiet): to 221 for _ in tqdm(range(int(max_flavors)), desc="Flavor chain", disable=self.config.quiet):

Can't really wrap my head around why its happening at all.. or just wait for the fix :) (after change restart webui-user.bat)