InvokeAI/invokeai/backend
Lincoln Stein f329fddab9 make step_callback work again in generate() call
This PR fixes #2951 and restores the step_callback argument in the
refactored generate() method. Note that this issue states that
"something is still wrong because steps and step are zero." However,
I think this is confusion over the call signature of the callback, which
since the diffusers merge has been `callback(state:PipelineIntermediateState)`

This is the test script that I used to determine that `step` is being passed
correctly:

```

from pathlib import Path
from invokeai.backend import ModelManager, PipelineIntermediateState
from invokeai.backend.globals import global_config_dir
from invokeai.backend.generator import Txt2Img

def my_callback(state:PipelineIntermediateState, total_steps:int):
    print(f'callback(step={state.step}/{total_steps})')

def main():
    manager = ModelManager(Path(global_config_dir()) / "models.yaml")
    model = manager.get_model('stable-diffusion-1.5')
    print ('=== TXT2IMG TEST ===')
    steps=30
    output = next(Txt2Img(model).generate(prompt='banana sushi',
                                          iterations=None,
                                          steps=steps,
                                          step_callback=lambda x: my_callback(x,steps)
                                          )
                  )
    print(f'image={output.image}, seed={output.seed}, steps={output.params.steps}')

if __name__=='__main__':
    main()
```
2023-03-24 09:32:47 +11:00
..
config during migration do not overwrite symlinks 2023-03-05 08:40:12 -05:00
generator make step_callback work again in generate() call 2023-03-24 09:32:47 +11:00
image_util all vestiges of ldm.invoke removed 2023-03-03 01:02:00 -05:00
model_management load embeddings after a ckpt legacy model is converted to diffusers 2023-03-23 15:21:58 -04:00
prompting backend..conditioning: remove code for legacy model 2023-03-09 18:15:12 -08:00
restoration remove legacy ldm code 2023-03-04 18:16:59 -08:00
stable_diffusion load embeddings after a ckpt legacy model is converted to diffusers 2023-03-23 15:21:58 -04:00
training migrate to new HF diffusers cache location 2023-03-05 08:20:24 -05:00
util feat(backend): add image_to_dataURL util 2023-03-16 20:03:08 +11:00
web backend..conditioning: remove code for legacy model 2023-03-09 18:15:12 -08:00
__init__.py make step_callback work again in generate() call 2023-03-24 09:32:47 +11:00
args.py fix --png_compression command line argument 2023-03-14 00:24:05 -04:00
generate.py add restoration services to nodes 2023-03-11 17:00:00 -05:00
globals.py Unified spelling of Hugging Face 2023-03-05 07:30:35 -06:00
safety_checker.py restore NSFW checker 2023-03-11 16:16:44 -05:00