Commit ·
d58278e
1
Parent(s): 45e7b61
Handle tuple output from workflow and ensure tensor extraction in _gpu_logic
Browse files
core/pipelines/sd_image_pipeline.py
CHANGED
|
@@ -36,6 +36,9 @@ class SdImagePipeline(BasePipeline):
|
|
| 36 |
initial_objects = {}
|
| 37 |
# Execute the workflow; it returns image tensor(s) from the VAE Decode node.
|
| 38 |
decoded_images_tensor = WorkflowExecutor.execute_workflow(workflow, initial_objects=initial_objects)
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# Convert tensors to PIL images, embed metadata and save them to the output directory.
|
| 41 |
out_dir = os.path.abspath(OUTPUT_DIR)
|
|
|
|
| 36 |
initial_objects = {}
|
| 37 |
# Execute the workflow; it returns image tensor(s) from the VAE Decode node.
|
| 38 |
decoded_images_tensor = WorkflowExecutor.execute_workflow(workflow, initial_objects=initial_objects)
|
| 39 |
+
# If the node returns a tuple/list, take the first element which holds the tensor.
|
| 40 |
+
if isinstance(decoded_images_tensor, (list, tuple)):
|
| 41 |
+
decoded_images_tensor = decoded_images_tensor[0]
|
| 42 |
|
| 43 |
# Convert tensors to PIL images, embed metadata and save them to the output directory.
|
| 44 |
out_dir = os.path.abspath(OUTPUT_DIR)
|