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

support HF models - freepik as first example #84

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/mflux/config/model_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@


class ModelConfig(Enum):
# ==== black-forest-labs official models =====
FLUX1_DEV = ("black-forest-labs/FLUX.1-dev", "dev", 1000, 512)
FLUX1_SCHNELL = ("black-forest-labs/FLUX.1-schnell", "schnell", 1000, 256)
# ==== third party compatible models - best effort compatibility =====
# https://huggingface.co/Freepik/flux.1-lite-8B-alpha distilled from dev
FLUX1_FREEPIK_LITE_8B_ALPHA = ("Freepik/flux.1-lite-8B-alpha", "freepik-lite-8b-alpha", 1000, 512)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

considered naming this FLUX1_FREEPIK_LITE_8B and pointing to the beta/final releases as the model matures. However, in python zen we should be more explicit than not..., so I prefer to still let users know exactly what they have to ask for and receive.


def __init__(
self,
Expand Down
3 changes: 2 additions & 1 deletion src/mflux/ui/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
GUIDANCE_SCALE = 3.5
HEIGHT, WIDTH = 1024, 1024
INIT_IMAGE_STRENGTH = 0.4 # for image-to-image init_image
MODEL_CHOICES = ["dev", "schnell"]
MODEL_CHOICES = ["dev", "schnell", "freepik-lite-8b-alpha"]
MODEL_INFERENCE_STEPS = {
"dev": 14,
"schnell": 4,
"freepik-lite-8b-alpha": 22,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

from their readme:

Flux.1 Lite is ready to unleash your creativity! For the best results, we strongly recommend using a guidance_scale of 3.5 and setting n_steps between 22 and 30.

I feel conflicted about having this value higher than dev, will play around to see if we can live with 10-14 range and give users faster generations by default.

}
QUANTIZE_CHOICES = [4, 8]