progress
This commit is contained in:
@@ -110,7 +110,7 @@ def generate_from_caption(
|
||||
|
||||
# Update seeds in nodes 20 and 21
|
||||
workflow["20"]["inputs"]["seed"] = seed
|
||||
workflow["21"]["inputs"]["seed"] = seed
|
||||
workflow["21"]["inputs"]["seed"] = seed + 1
|
||||
|
||||
# Generate unique filename prefix to ensure we copy the right file
|
||||
unique_id = str(uuid.uuid4())[:8]
|
||||
@@ -144,20 +144,15 @@ def generate_from_caption(
|
||||
# Create output directory next to caption file
|
||||
caption_dir = os.path.dirname(os.path.abspath(caption_file))
|
||||
caption_name = os.path.splitext(os.path.basename(caption_file))[0]
|
||||
output_dir = os.path.join(caption_dir, f"{caption_name}_{seed}")
|
||||
os.makedirs(output_dir, exist_ok=True)
|
||||
output_image_path = os.path.join(caption_dir, f"{caption_name}_{seed}_generated.png")
|
||||
|
||||
# Copy the generated image to output directory with a cleaner name
|
||||
output_image_path = os.path.join(output_dir, "generated.png")
|
||||
output_image_path = os.path.join(caption_dir, output_image_path)
|
||||
shutil.copy2(new_file, output_image_path)
|
||||
print(f"Saved image: {output_image_path}")
|
||||
|
||||
# Copy caption file
|
||||
caption_dest = os.path.join(output_dir, os.path.basename(caption_file))
|
||||
shutil.copy2(caption_file, caption_dest)
|
||||
print(f"Copied caption: {caption_dest}")
|
||||
|
||||
return output_dir
|
||||
return output_image_path
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user