Skip to content

Conversation

@mengniwang95
Copy link
Contributor

@mengniwang95 mengniwang95 commented Dec 8, 2025

User description

Fix Framepack issue


PR Type

Bug fix


Description

  • Simplify directory creation logic in main.py

Diagram Walkthrough

flowchart LR
  A["Check directory existence"] -- "Removed" --> B["Create directory"]
  B -- "Added" --> C["Create directory with exist_ok=True"]
Loading

File Walkthrough

Relevant files
Bug fix
main.py
Simplified directory creation                                                       

examples/pytorch/diffusion_model/diffusers/flux/main.py

  • Removed explicit check for directory existence
  • Used os.makedirs with exist_ok=True
+1/-2     

@PRAgent4INC
Copy link
Collaborator

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

The tune() function is being called recursively within itself when args.quantize is True, which could lead to infinite recursion and a stack overflow error.

print(f"Start to quantize {args.model}.")
tune()

@PRAgent4INC
Copy link
Collaborator

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Validate directory path

Ensure that args.output_image_path is a valid directory path before attempting to
create it.

examples/pytorch/diffusion_model/diffusers/flux/main.py [125]

-os.makedirs(args.output_image_path, exist_ok=True)
+if isinstance(args.output_image_path, str):
+    os.makedirs(args.output_image_path, exist_ok=True)
Suggestion importance[1-10]: 6

__

Why: The suggestion adds a check to ensure args.output_image_path is a string before creating the directory, which is a reasonable validation step. However, this is a minor improvement and does not address critical issues.

Low

Copy link
Contributor

@chensuyue chensuyue left a comment

Choose a reason for hiding this comment

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

Test pass.

@chensuyue chensuyue merged commit 0a87139 into master Dec 9, 2025
15 checks passed
@chensuyue chensuyue deleted the mengniwang95-patch-3 branch December 9, 2025 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants