instantX-research / CSGO

CSGO: Content-Style Composition in Text-to-Image Generation 🔥
https://csgo-gen.github.io/
244 stars 8 forks source link

gradio runs error #3

Closed t00350320 closed 1 month ago

t00350320 commented 1 month ago

gradio app.py error code:

base_model_path = f"/home/notebook/code/personal/models/checkpoints/stable-diffusion-xl-base-1.0/sd_xl_base_1.0.safetensors"
image_encoder_path = f"/home/notebook/code/personal/models/checkpoints/IP-Adapter/sdxl_models/image_encoder"
csgo_ckpt =f'/home/notebook/code/personal/CSGO/CSGO/csgo.bin'
#pretrained_vae_name_or_path =f'/home/notebook/code/personal/CSGO/madebyollin/sdxl-vae-fp16-fix/sdxl.vae.safetensors'
pretrained_vae_name_or_path ='madebyollin/sdxl-vae-fp16-fix'
controlnet_path = f"/home/notebook/code/personal/CSGO/TTPlanet/TTPLanet_SDXL_Controlnet_Tile_Realistic"

errors

  File "/home/notebook/code/personal/CSGO/gradio/app.py", line 106, in run_for_examples
    return create_image(
  File "/home/notebook/code/personal/CSGO/gradio/app.py", line 146, in create_image
    csgo = CSGO(pipe, image_encoder_path, csgo_ckpt, device, num_content_tokens=4, num_style_tokens=32,
  File "/home/notebook/code/personal/CSGO/./ip_adapter/ip_adapter.py", line 317, in __init__
    self.load_ip_adapter()
  File "/home/notebook/code/personal/CSGO/./ip_adapter/ip_adapter.py", line 494, in load_ip_adapter
    self.style_image_proj_model.load_state_dict(state_dict["style_image_proj"])
  File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2041, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Resampler:
        size mismatch for latents: copying a param with shape torch.Size([1, 16, 2048]) from checkpoint, the shape in current model is torch.Size([1, 32, 2048]).
xingp-ng commented 1 month ago

csgo.bin

you should choose csgo_4_32.bin for num_style_tokens=32. if you want to use csgo.bin, adjust num_style_tokens=16

t00350320 commented 1 month ago

csgo.bin

you should choose csgo_4_32.bin for num_style_tokens=32. if you want to use csgo.bin, adjust num_style_tokens=16

it's great !

can you share a wechat group code ? -_-