XLabs-AI / x-flux

Apache License 2.0
1.63k stars 118 forks source link

One place of code redundancy #91

Closed wendashi closed 2 months ago

wendashi commented 2 months ago

In the file: https://github.com/XLabs-AI/x-flux/blob/main/src/flux/xflux_pipeline.py from 62 to 72 line:

I think it's exactly the same operation twice?

      for key, value in checkpoint.items():
          if key.startswith(prefix):
              blocks[key[len(prefix):].replace('.processor.', '.')] = value
          if key.startswith("ip_adapter_proj_model"):
              proj[key[len("ip_adapter_proj_model."):]] = value

      for key, value in checkpoint.items():
          if key.startswith(prefix):
              blocks[key[len(prefix):].replace('.processor.', '.')] = value
          if key.startswith("ip_adapter_proj_model"):
              proj[key[len("ip_adapter_proj_model."):]] = value
Anghellia commented 2 months ago

Thank you for noticing! Removed with https://github.com/XLabs-AI/x-flux/commit/ddc8351b83ebdfaef13b00f618a4dd21013330f3