more fixes for comfydeploy

This commit is contained in:
nofunstudio
2025-04-09 11:17:37 -06:00
parent 45f86661e3
commit 2ccd267404
2 changed files with 8 additions and 1 deletions
Binary file not shown.
+8 -1
View File
@@ -53,7 +53,7 @@ def fun_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, neg
out = latent.copy()
out["samples"] = samples
return (out, None) # Return None for preview_latents since we're saving directly
return (out, callback.get_results()) # Return the results from the callback
class PreviewCallback:
def __init__(self, latent, preview_steps_list, vae, model):
@@ -65,11 +65,15 @@ class PreviewCallback:
self.type = "output"
self.prefix_append = ""
self.compress_level = 4
self.results = [] # Store results for later retrieval
# Initialize previewer using the model's latent_format
self.previewer = latent_preview.get_previewer("cpu", model.model.latent_format)
if self.previewer is None:
print("Warning: No preview method available, falling back to full VAE for previews")
def get_results(self):
return {"ui": {"images": self.results}}
def __call__(self, step, denoised, x, total_steps):
if step in self.preview_steps_list:
# Create a copy of the current state
@@ -115,6 +119,9 @@ class PreviewCallback:
"output_id": "preview_images"
}
# Add to results list
self.results.append(result)
print(f"Saved preview image to: {file_path}")
class KSampler: