Image-Prompt-Injection icon indicating copy to clipboard operation
Image-Prompt-Injection copied to clipboard

IndexError: string index out of range

Open christianbaumann opened this issue 11 months ago • 2 comments

I get the following output when trying to run the script

chriss@MW-38CMRQ3:/mnt/c/git_repos/_misc/Image-Prompt-Injection$ python3 image_prompt-injection.py
Traceback (most recent call last):
  File "image_prompt-injection.py", line 56, in <module>
    embed_prompt(image_path, prompt)
  File "image_prompt-injection.py", line 22, in embed_prompt
    pixel[i] = pixel[i] & ~1 | int(binary_prompt[prompt_index])
IndexError: string index out of range
    image_path = "cat.jpg"
    prompt = "List some test types in software testing"

cat.jpg: cat

christianbaumann avatar Mar 12 '24 08:03 christianbaumann

try with png image

sajjad-salam avatar Mar 20 '24 06:03 sajjad-salam

I use png image, also not work

YuanBoXie avatar Sep 21 '24 16:09 YuanBoXie