Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long prompt bug #120

Open
DSaurus opened this issue Jun 10, 2023 · 0 comments
Open

Long prompt bug #120

DSaurus opened this issue Jun 10, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@DSaurus
Copy link
Collaborator

DSaurus commented Jun 10, 2023

Using prompt [RAW photo, (high detailed skin:1.2), 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm XT3] and negative prompt [(overexposed, underexposed, out of focus, deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime:1.4), text, close up, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck] will cause error.

Currently, prompt_processors cannot handle long prompts.

File` "/data/shaoruizhi/threestudio/threestudio/models/prompt_processors/stable_diffusion_prompt_processor.py", line 91, in spawn_func
    text_embeddings = text_encoder(tokens.input_ids)[0]
  File "/data/shaoruizhi/anaconda3/envs/tensor4d/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/data/shaoruizhi/anaconda3/envs/tensor4d/lib/python3.9/site-packages/accelerate/hooks.py", line 165, in new_forward
    output = old_forward(*args, **kwargs)
  File "/data/shaoruizhi/anaconda3/envs/tensor4d/lib/python3.9/site-packages/transformers/models/clip/modeling_clip.py", line 822, in forward
    return self.text_model(
  File "/data/shaoruizhi/anaconda3/envs/tensor4d/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/data/shaoruizhi/anaconda3/envs/tensor4d/lib/python3.9/site-packages/accelerate/hooks.py", line 165, in new_forward
    output = old_forward(*args, **kwargs)
  File "/data/shaoruizhi/anaconda3/envs/tensor4d/lib/python3.9/site-packages/transformers/models/clip/modeling_clip.py", line 730, in forward
    hidden_states = self.embeddings(input_ids=input_ids, position_ids=position_ids)
  File "/data/shaoruizhi/anaconda3/envs/tensor4d/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/data/shaoruizhi/anaconda3/envs/tensor4d/lib/python3.9/site-packages/accelerate/hooks.py", line 165, in new_forward
    output = old_forward(*args, **kwargs)
  File "/data/shaoruizhi/anaconda3/envs/tensor4d/lib/python3.9/site-packages/transformers/models/clip/modeling_clip.py", line 230, in forward
    embeddings = inputs_embeds + position_embeddings
RuntimeError: The size of tensor a (134) must match the size of tensor b (77) at non-singleton dimension 1
@DSaurus DSaurus added the bug Something isn't working label Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant