ljleb / prompt-fusion-extension

auto1111 webui extension for all sorts of prompt interpolations!
MIT License
268 stars 16 forks source link

A1111 1.6 break #65

Closed pmcculler closed 1 year ago

pmcculler commented 1 year ago

A prompt with only this line and disabling other extensions causes a gen-halting error:

It does not error if prompt fusion is disabled in settings.

Error:

Traceback (most recent call last):
  File "D:\Users\pmccu\stable-diffusion-webui\modules\call_queue.py", line 57, in f
    res = list(func(*args, **kwargs))
  File "D:\Users\pmccu\stable-diffusion-webui\modules\call_queue.py", line 36, in f
    res = func(*args, **kwargs)
  File "D:\Users\pmccu\stable-diffusion-webui\modules\txt2img.py", line 55, in txt2img
    processed = processing.process_images(p)
  File "D:\Users\pmccu\stable-diffusion-webui\modules\processing.py", line 732, in process_images
    res = process_images_inner(p)
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
    return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
  File "D:\Users\pmccu\stable-diffusion-webui\modules\processing.py", line 856, in process_images_inner
    p.setup_conds()
  File "D:\Users\pmccu\stable-diffusion-webui\modules\processing.py", line 1309, in setup_conds
    super().setup_conds()
  File "D:\Users\pmccu\stable-diffusion-webui\modules\processing.py", line 470, in setup_conds
    self.c = self.get_conds_with_caching(prompt_parser.get_multicond_learned_conditioning, prompts, total_steps, [self.cached_c], self.extra_network_data)
  File "D:\Users\pmccu\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 "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\hijacker.py", line 12, in wrapper
    return function(*args, **kwargs, original_function=self.__original_functions[attribute])
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\scripts\promptlang.py", line 91, in _hijacked_get_multicond_learned_conditioning
    res = original_function(*args, **kwargs)
  File "D:\Users\pmccu\stable-diffusion-webui\modules\prompt_parser.py", line 262, in get_multicond_learned_conditioning
    learned_conditioning = get_learned_conditioning(model, prompt_flat_list, steps, hires_steps, use_old_scheduling)
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\hijacker.py", line 12, in wrapper
    return function(*args, **kwargs, original_function=self.__original_functions[attribute])
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\scripts\promptlang.py", line 42, in _hijacked_get_learned_conditioning
    tensor_builders = _parse_tensor_builders(prompts, real_total_steps)
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\scripts\promptlang.py", line 102, in _parse_tensor_builders
    expr.extend_tensor(tensor_builder, (0, total_steps), total_steps, dict())
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\ast_nodes.py", line 21, in extend_tensor
    expr_extend_tensor(expression)
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\ast_nodes.py", line 16, in expr_extend_tensor
    expr.extend_tensor(tensor_builder, steps_range, total_steps, context)
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\ast_nodes.py", line 155, in extend_tensor
    expr.extend_tensor(tensor_builder, expr_steps_range, total_steps, context)
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\ast_nodes.py", line 18, in extend_tensor
    expr_extend_tensor(self.__expressions[0])
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\ast_nodes.py", line 16, in expr_extend_tensor
    expr.extend_tensor(tensor_builder, steps_range, total_steps, context)
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\ast_nodes.py", line 155, in extend_tensor
    expr.extend_tensor(tensor_builder, expr_steps_range, total_steps, context)
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\ast_nodes.py", line 18, in extend_tensor
    expr_extend_tensor(self.__expressions[0])
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\ast_nodes.py", line 16, in expr_extend_tensor
    expr.extend_tensor(tensor_builder, steps_range, total_steps, context)
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\ast_nodes.py", line 98, in extend_tensor
    speed = _eval_float(self.__speed, steps_range, total_steps, context)
  File "D:\Users\pmccu\stable-diffusion-webui\extensions\sd-prompt-fusion-extension\lib_prompt_fusion\ast_nodes.py", line 243, in _eval_float
    expression.extend_tensor(interpolation_tensor.InterpolationTensorBuilder(prompt_database=mock_database), steps_range, total_steps, context)
AttributeError: 'int' object has no attribute 'extend_tensor'
pmcculler commented 1 year ago

OK... this does not cause the error:

ljleb commented 1 year ago

I had the fix locally but was really tired yesterday and forgot to push. Should be fixed now.

Thanks for reporting!