AIrjen / OneButtonPrompt

One Button Prompt
GNU General Public License v3.0
856 stars 86 forks source link

Index out of error when seelcting humanoid genders #100

Closed jcbordo closed 1 year ago

jcbordo commented 1 year ago

The error occurs when selecting Humanoid from the Subject Types, then changing the gender to anything other than 'all" selecting either male or female will result in this error. Choice of Type of Humanoid has no effect.

Here is the error:

`Please note that existing prompt and negative prompt fields are (no longer) used
Starting generating the prompt
*** Error completing request
*** Arguments: ('task(qi51hrcqfh46tee)', '\n\n', '', [], 30, 0, False, False, 1, 1, 7, 3102042158.0, -1.0, 0, 0, 0, False, 768, 576, False, 0.7, 2, 'Latent', 0, 0, 0, 0, '', '', [], <gradio.routes.Request object at 0x000001F8A8B3B1F0>, 5, False, {'ad_model': 'face_yolov8n.pt', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 32, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_sampler': False, 'ad_sampler': 'Euler a', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 32, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_sampler': False, 'ad_sampler': 'Euler a', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 1536, 96, True, True, True, False, True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', False, False, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, None, 'Refresh models', <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001F8A8B278E0>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001F84E36E140>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001F8A8AE5660>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001F8A8B24C10>, False, '', 0.5, True, False, '', 'Lerp', False, False, False, 'Matrix', 'Horizontal', 'Mask', 'Prompt', '1,1', '0.2', False, False, False, 'Attention', False, '0', '0', '0.4', None, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False, False, False, '#000000', False, 5, 'humanoid', 'popular', 'all', '', '', 'BadDream UnrealisticDream JuggernautNegative-neg ng_deepnegative_v1_75t verybadimagenegative_v1.3,', '1', 'none', False, '', '', 'comma', '', True, '', '20', 'male', 'all', 'humanoids', 'all', None, None, False, None, None, False, None, None, False, None, None, False, 50) {}
    Traceback (most recent call last):
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\modules\call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\modules\txt2img.py", line 59, in txt2img
        processed = modules.scripts.scripts_txt2img.run(p, *args)
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\modules\scripts.py", line 501, in run
        processed = script.run(p, *script_args)
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\extensions\OneButtonPrompt\scripts\onebuttonprompt.py", line 1031, in run
        preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype, False, antistring, prefixprompt, suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance,chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept)
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\extensions\OneButtonPrompt\build_dynamic_prompt.py", line 35, in build_dynamic_prompt
        fictionallist = csv_to_list(csvfilename="fictional characters",antilist=antilist,skipheader=True,gender=gender)
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\extensions\OneButtonPrompt\csv_reader.py", line 51, in csv_to_list
        (gender != "all" and row[1] == gender)
    IndexError: list index out of range
AIrjen commented 1 year ago

Hi! You probably have an override file for Fictional Characters in place. This CSV file had a new column added, called gender. You might need to update your overwrite CSV file. Most of the human related CSV files had a gender column added into the CSV file.

jcbordo commented 1 year ago

Thank you! that was it.