(x_samples, i, *args)
| 211 | |
| 212 | def make_step_callback(context, callback): |
| 213 | def on_step(x_samples, i, *args): |
| 214 | stream_image_progress = opts.get("stream_image_progress", False) |
| 215 | stream_image_progress_interval = opts.get("stream_image_progress_interval", 3) |
| 216 | |
| 217 | if context.test_diffusers: |
| 218 | context.partial_x_samples = (x_samples, args[0]) |
| 219 | else: |
| 220 | context.partial_x_samples = x_samples |
| 221 | |
| 222 | if stream_image_progress and stream_image_progress_interval > 0 and i % stream_image_progress_interval == 0: |
| 223 | if context.test_diffusers: |
| 224 | images = diffusers_latent_samples_to_images(context, context.partial_x_samples) |
| 225 | else: |
| 226 | images = latent_samples_to_images(context, context.partial_x_samples) |
| 227 | else: |
| 228 | images = None |
| 229 | |
| 230 | if callback: |
| 231 | callback(images, i, *args) |
| 232 | |
| 233 | if context.stop_processing: |
| 234 | raise UserInitiatedStop("User requested that we stop processing") |
| 235 | |
| 236 | return on_step |
| 237 |
nothing calls this directly
no test coverage detected