InvokeAI/invokeai
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
..
app fix(nodes): fix step_callback + fast latents generation 2023-03-16 20:03:08 +11:00
assets Various fixes 2023-01-30 18:42:17 -05:00
backend make step_callback work again in generate() call 2023-03-24 09:32:47 +11:00
configs support both epsilon and v-prediction v2 inference 2023-03-05 22:51:40 -05:00
frontend Merge branch 'main' into export-more-for-header 2023-03-21 16:29:53 -04:00
version fix issue with invokeai.version 2023-03-03 01:34:38 -05:00
__init__.py Various fixes 2023-01-30 18:42:17 -05:00
README CODEOWNERS coarse draft 2023-03-03 14:36:43 -05:00

Organization of the source tree:

app -- Home of nodes invocations and services
assets -- Images and other data files used by InvokeAI
backend -- Non-user facing libraries, including the rendering
	core.
configs -- Configuration files used at install and run times
frontend -- User-facing scripts, including the CLI and the WebUI
version -- Current InvokeAI version string, stored
	in version/invokeai_version.py