Skip to content

Conversation

@Q3g
Copy link

@Q3g Q3g commented Nov 7, 2025

I discovered this project yesterday and encountered some issues during installation due to unfamiliarity with uv.
When running uv tool install --upgrade mflux and mflux-generate --model schnell --prompt "Luxury food photograph" --steps 2 --seed 2 -q 8, I got the following error:
ValueError: Fast download using 'hf_transfer' is enabled (HF_HUB_ENABLE_HF_TRANSFER=1) but 'hf_transfer' package is not available in your environment. Try pip install hf_transfer.
For users who prefer not to manually set environment variables or are new to uv, this can be confusing and prevents the installation from being truly "out-of-the-box."
So I added a collapsible troubleshooting section under the installation guide.

Summary by CodeRabbit

  • Documentation
    • Added troubleshooting guidance for Hugging Face transfer download errors with installation instructions to enable faster model downloads.

Add collapsible troubleshooting section in installation guide to help users resolve hf_transfer errors when using uv tool install. Users can now easily find the solution to install with --with hf_transfer flag for faster downloads.
@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Walkthrough

Two troubleshooting sections are added to README.md to address Hugging Face transfer download errors, explaining the issue and providing installation instructions for the hf_transfer package with MFLUX.

Changes

Cohort / File(s) Summary
Documentation updates
README.md
Adds two troubleshooting sections describing HF transfer download errors and providing the installation command: uv tool install --upgrade mflux --with hf_transfer. Includes configuration details for faster model downloads from Hugging Face.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Verify that the troubleshooting sections are placed logically within the README structure
  • Confirm the installation command syntax is accurate and matches current tooling conventions
  • Check that both sections contain consistent and accurate information

Poem

🐰✨ Two sections hop into the README's light,
With installation spells to make HF transfers right!
Faster downloads now, no errors to fright,
The troubleshooting burrow shines so bright! 🌟

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding a troubleshooting section for hf_transfer installation to the README.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ffce6ce and 40867c9.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🔇 Additional comments (1)
README.md (1)

140-153: Well-structured troubleshooting addition that effectively addresses a real user pain point.

The collapsible section clearly presents the problem with the exact error message (making it highly searchable), provides an actionable solution, and explains the benefit. The placement after the main installation instructions is logical, and the formatting is consistent with existing collapsible sections in the README. This should significantly reduce confusion for users encountering the hf_transfer installation issue when using uv tool install.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Collaborator

@anthonywu anthonywu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion here is to just include it in the library instead of expecting users to come back to a readme.

If you're interested in making this change, just update this PR. Otherwise we'll just do this at the next release.

README.md Outdated
If you encounter a `ValueError: Fast download using 'hf_transfer' is enabled (HF_HUB_ENABLE_HF_TRANSFER=1) but 'hf_transfer' package is not available`, you can install MFLUX with the `hf_transfer` package included:

```sh
uv tool install --upgrade mflux --with hf_transfer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an even more durable solution is just to include it in the project dependencies in pyproject.toml

https://pypi.org/project/hf-transfer/#history

hf-transfer>=0.1.9,<1.0 in this list: https://github.com/filipstrand/mflux/blob/main/pyproject.toml#L28

The library has been out for a while and it's maintained by HuggingFace so I feel comfortable just including it as a universal dependency

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!

My main hesitation was that I wasn’t entirely sure why transformers itself doesn’t include hf-transfer as a direct dependency, so I kept the previous behavior to avoid unintended issues. But given that we mostly target macOS, I agree that adding hf-transfer directly should be fine and unlikely to cause any problems.

I’ve updated the PR accordingly. Thanks again!

- **Root cause**
  - Users with HF_HUB_ENABLE_HF_TRANSFER=1 encountered ValueError
    because hf_transfer package was not installed by default

- **What was done**
  - Added hf-transfer>=0.1.9,<1.0 to project dependencies
  - Removed troubleshooting section from README (no longer needed)

- **Verification**
  - Package maintained by HuggingFace with stable release history
  - Enables faster model downloads automatically for all users
Copy link
Collaborator

@anthonywu anthonywu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @filipstrand this looks safe to release next time you bump version

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.

2 participants