현재 메인 이미지 생성은 sdxl모델로하고
bmab 통해서 얼굴만 sd1.5모델로 생성하려고 합니다
webui에서 bmab > context > checkpoint에 sd1.5모델 넣어서 face detailer 설정하면 원하는대로 생성이 잘 됩니다
근데 API로 진행하면 아래와 같은 오류가 나옵니다
Using already loaded model turbovisionxlSuperFastXLBasedOnNew_tvxlV431Bakedvae.safetensors [b62ddba1a6]: done in 0.1s
Traceback (most recent call last):
File "/stable-diffusion-webui/extensions/z_bmab/sd_bmab/pipeline/post/mainpipe.py", line 63, in process
ret = proc.process(context, processed)
File "/stable-diffusion-webui/extensions/z_bmab/sd_bmab/processors/detailer/face.py", line 184, in process
img2img_imgage = process_img2img(context.sdprocessing, image, options=options)
File "/stable-diffusion-webui/extensions/z_bmab/sd_bmab/base/process.py", line 106, in process_img2img
processed = process_images(img2img)
File "/stable-diffusion-webui/modules/processing.py", line 734, in process_images
res = process_images_inner(p)
File "/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 41, in processing_process_images_hijack
return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, kwargs)
File "/stable-diffusion-webui/modules/processing.py", line 857, in process_images_inner
p.setup_conds()
File "/stable-diffusion-webui/modules/processing.py", line 469, in setup_conds
self.uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, total_steps, [self.cached_uc], self.extra_network_data)
File "/stable-diffusion-webui/modules/processing.py", line 455, in get_conds_with_caching
cache[1] = function(shared.sd_model, required_prompts, steps, hires_steps, shared.opts.use_old_scheduling)
File "/stable-diffusion-webui/modules/prompt_parser.py", line 188, in get_learned_conditioning
conds = model.get_learned_conditioning(texts)
File "/stable-diffusion-webui/modules/sd_models_xl.py", line 31, in get_learned_conditioning
c = self.conditioner(sdxl_conds, force_zero_embeddings=['txt'] if force_zero_negative_prompt else [])
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, *kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1568, in _call_impl
result = forward_call(args, kwargs)
File "/stable-diffusion-webui/repositories/generative-models/sgm/modules/encoders/modules.py", line 141, in forward
emb_out = embedder(batch[embedder.input_key])
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, *kwargs)
File "/stable-diffusion-webui/modules/sd_hijack_clip.py", line 234, in forward
z = self.process_tokens(tokens, multipliers)
File "/stable-diffusion-webui/modules/sd_hijack_clip.py", line 273, in process_tokens
z = self.encode_with_transformers(tokens)
File "/stable-diffusion-webui/modules/sd_hijack_open_clip.py", line 57, in encode_with_transformers
d = self.wrapped.encode_with_transformer(tokens)
File "/stable-diffusion-webui/repositories/generative-models/sgm/modules/encoders/modules.py", line 467, in encode_with_transformer
x = self.model.token_embedding(text) # [batch_size, n_ctx, d_model]
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(args, kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/stable-diffusion-webui/modules/sd_hijack.py", line 359, in forward
tensor = torch.cat([tensor[0:offset + 1], emb[0:emb_len], tensor[offset + 1 + emb_len:]])
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 1280 but got size 768 for tensor number 1 in the list.
안녕하세요
현재 메인 이미지 생성은 sdxl모델로하고 bmab 통해서 얼굴만 sd1.5모델로 생성하려고 합니다
webui에서 bmab > context > checkpoint에 sd1.5모델 넣어서 face detailer 설정하면 원하는대로 생성이 잘 됩니다 근데 API로 진행하면 아래와 같은 오류가 나옵니다
Using already loaded model turbovisionxlSuperFastXLBasedOnNew_tvxlV431Bakedvae.safetensors [b62ddba1a6]: done in 0.1s Traceback (most recent call last): File "/stable-diffusion-webui/extensions/z_bmab/sd_bmab/pipeline/post/mainpipe.py", line 63, in process ret = proc.process(context, processed) File "/stable-diffusion-webui/extensions/z_bmab/sd_bmab/processors/detailer/face.py", line 184, in process img2img_imgage = process_img2img(context.sdprocessing, image, options=options) File "/stable-diffusion-webui/extensions/z_bmab/sd_bmab/base/process.py", line 106, in process_img2img processed = process_images(img2img) File "/stable-diffusion-webui/modules/processing.py", line 734, in process_images res = process_images_inner(p) File "/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 41, in processing_process_images_hijack return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, kwargs) File "/stable-diffusion-webui/modules/processing.py", line 857, in process_images_inner p.setup_conds() File "/stable-diffusion-webui/modules/processing.py", line 469, in setup_conds self.uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, total_steps, [self.cached_uc], self.extra_network_data) File "/stable-diffusion-webui/modules/processing.py", line 455, in get_conds_with_caching cache[1] = function(shared.sd_model, required_prompts, steps, hires_steps, shared.opts.use_old_scheduling) File "/stable-diffusion-webui/modules/prompt_parser.py", line 188, in get_learned_conditioning conds = model.get_learned_conditioning(texts) File "/stable-diffusion-webui/modules/sd_models_xl.py", line 31, in get_learned_conditioning c = self.conditioner(sdxl_conds, force_zero_embeddings=['txt'] if force_zero_negative_prompt else []) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1568, in _call_impl result = forward_call(args, kwargs) File "/stable-diffusion-webui/repositories/generative-models/sgm/modules/encoders/modules.py", line 141, in forward emb_out = embedder(batch[embedder.input_key]) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, *kwargs) File "/stable-diffusion-webui/modules/sd_hijack_clip.py", line 234, in forward z = self.process_tokens(tokens, multipliers) File "/stable-diffusion-webui/modules/sd_hijack_clip.py", line 273, in process_tokens z = self.encode_with_transformers(tokens) File "/stable-diffusion-webui/modules/sd_hijack_open_clip.py", line 57, in encode_with_transformers d = self.wrapped.encode_with_transformer(tokens) File "/stable-diffusion-webui/repositories/generative-models/sgm/modules/encoders/modules.py", line 467, in encode_with_transformer x = self.model.token_embedding(text) # [batch_size, n_ctx, d_model] File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "/stable-diffusion-webui/modules/sd_hijack.py", line 359, in forward tensor = torch.cat([tensor[0:offset + 1], emb[0:emb_len], tensor[offset + 1 + emb_len:]]) RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 1280 but got size 768 for tensor number 1 in the list.
아래는 API payload입니다
'BMAB': { 'args': [ { 'enabled': True, "preprocess_checkpoint": "salmonholic_real_v2.8.safetensors", "preprocess_vae": "vae-ft-mse-840000-ema-pruned.ckpt", 'face_detailing_enabled': True, "module_config": { "face_detailing_opt": { "best_quality": True, "sort_by": "Score", "limit": 1, "prompt0": ",korean idol mix, clean skin,", "negative_prompt0": "", "override_parameter": False, "sampler": "DPM++ 3M SDE Karras", "detection_model": "BMAB Face(Normal)", "dilation": 4, "box_threshold": 0.35, "skip_large_face": False, "large_face_pixels": 0.26 }, "face_detailing": { "width": 512, "height": 512, "cfg_scale": 4, "steps": 12, "mask_blur": 4, "inpaint_full_res": "Only masked", "inpaint_full_res_padding": 32, "denoising_strength": 0.38 }, } } ] }
webui에서 설정한 내용과 동일하게 API 구성한 것 같은데 왜 사이즈가 다르다는 오류가 나는지 모르겠습니다 도움 부탁드립니다!