Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: add original image handling and return types in BizyAirSegmentAnythingPointBox #249

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

lcolok
Copy link
Contributor

@lcolok lcolok commented Nov 28, 2024

Workflow:
Fill+Redux+SAM(原作者:Lingyuzhou).json

image
This PR improves the BizyAirSegmentAnythingPointBox node by adding an additional output that passes through the original input image, optimizing workflows that involve FLUX Fill + Redux.

Previous Behavior

  • The node only output the processed image (with alpha channel) and the mask
  • Workflows like FLUX Fill + Redux required uploading the same image twice:
    1. Once for the SAM processing
    2. Again for the actual fill operation

New Behavior

  • Added a third output that passes through the original input image
  • The original image is efficiently cloned and passed through without unnecessary conversions
  • FLUX Fill + Redux workflows now only need to upload the image once, as the original image is available directly from the SAM node

Benefits

  • Reduces redundant image uploads in complex workflows
  • Improves workflow efficiency and reduces resource usage
  • Maintains image quality by avoiding unnecessary conversions

Implementation Details

  • Added "IMAGE" as third return type with "original_image" return name
  • Uses efficient image cloning to pass through the original image
  • No breaking changes to existing functionality

工作流:
Fill+Redux+SAM(原作者:Lingyuzhou).json

SAM.Pick.mp4

本次PR优化了BizyAirSegmentAnythingPointBox节点,增加了原图透传输出,以更好地支持FLUX Fill + Redux等工作流场景。

现有问题

  • 节点目前只输出处理后的图像(带alpha通道)和mask
  • 在FLUX Fill + Redux等工作流中需要重复上传同一张图片:
    1. 首次上传用于SAM处理
    2. 再次上传用于实际的填充操作

改进方案

  • 新增第三个输出用于透传原始输入图像
  • 通过高效的克隆方式实现原图透传,避免不必要的格式转换
  • FLUX Fill + Redux工作流现在只需要上传一次图片,可直接从SAM节点获取原图

优化效果

  • 减少复杂工作流中的重复图片上传
  • 提升工作流效率,降低资源占用
  • 避免不必要的图像转换,保持图像质量

实现细节

  • 在返回类型中新增"IMAGE"作为第三个输出,返回名称为"original_image"
  • 使用图像克隆实现高效的原图透传
  • 保持向后兼容,不影响现有功能

@ccssu ccssu enabled auto-merge (squash) November 28, 2024 11:45
@ccssu ccssu disabled auto-merge November 28, 2024 11:45
@ccssu ccssu enabled auto-merge (squash) November 28, 2024 11:47
@ccssu ccssu disabled auto-merge November 28, 2024 11:47
@doombeaker doombeaker merged commit 607199c into siliconflow:master Nov 29, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants