ckpt / Lumina-Next-SFT

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: June 17 2024
text-to-image

Introduction of Lumina-Next-SFT

Model Details of Lumina-Next-SFT

Lumina-Next-SFT

The Lumina-Next-SFT is a Next-DiT model containing 2B parameters and utilizes Gemma-2B as the text encoder, enhanced through high-quality supervised fine-tuning (SFT).

Our generative model has Next-DiT as the backbone, the text encoder is the Gemma 2B model, and the VAE uses a version of sdxl fine-tuned by stabilityai.

paper

📰 News
  • [2024-06-08] 🎉🎉🎉 We have released the Lumina-Next-SFT model.

  • [2024-05-28] We updated the Lumina-Next-T2I model to support 2K Resolution image generation.

  • [2024-05-16] We have converted the .pth weights to .safetensors weights. Please pull the latest code to use demo.py for inference.

  • [2024-05-12] We release the next version of Lumina-T2I , called Lumina-Next-T2I for faster and lower memory usage image generation model.

🎮 Model Zoo

More checkpoints of our model will be released soon~

Resolution Next-DiT Parameter Text Encoder Prediction Download URL
1024 2B Gemma-2B Rectified Flow hugging face
Installation

Before installation, ensure that you have a working nvcc

# The command should work and show the same version number as in our case. (12.1 in our case).
nvcc --version

On some outdated distros (e.g., CentOS 7), you may also want to check that a late enough version of gcc is available

# The command should work and show a version of at least 6.0.
# If not, consult distro-specific tutorials to obtain a newer version or build manually.
gcc --version

Downloading Lumina-T2X repo from GitHub:

git clone https://github.com/Alpha-VLLM/Lumina-T2X
1. Create a conda environment and install PyTorch

Note: You may want to adjust the CUDA version according to your driver version .

conda create -n Lumina_T2X -y
conda activate Lumina_T2X
conda install python=3.11 pytorch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 pytorch-cuda=12.1 -c pytorch -c nvidia -y
2. Install dependencies
pip install diffusers fairscale accelerate tensorboard transformers gradio torchdiffeq click

or you can use

cd lumina_next_t2i
pip install -r requirements.txt
3. Install flash-attn
pip install flash-attn --no-build-isolation
4. Install nvidia apex (optional)

While Apex can improve efficiency, it is not a must to make Lumina-T2X work.

Note that Lumina-T2X works smoothly with either:

  • Apex not installed at all; OR
  • Apex successfully installed with CUDA and C++ extensions.

However, it will fail when:

  • A Python-only build of Apex is installed.

If the error No module named 'fused_layer_norm_cuda' appears, it typically means you are using a Python-only build of Apex. To resolve this, please run pip uninstall apex , and Lumina-T2X should then function correctly.

You can clone the repo and install following the official guidelines (note that we expect a full build, i.e., with CUDA and C++ extensions)

pip install ninja
git clone https://github.com/NVIDIA/apex
cd apex
# if pip >= 23.1 (ref: https://pip.pypa.io/en/stable/news/#v23-1) which supports multiple `--config-settings` with the same key... 
pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" ./
# otherwise
pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --global-option="--cpp_ext" --global-option="--cuda_ext" ./
Inference

To ensure that our generative model is ready to use right out of the box, we provide a user-friendly CLI program and a locally deployable Web Demo site.

CLI
  1. Install Lumina-Next-T2I
pip install -e .
  1. Prepare the pre-trained model

⭐⭐ (Recommended) you can use huggingface_cli to download our model:

huggingface-cli download --resume-download Alpha-VLLM/Lumina-Next-T2I --local-dir /path/to/ckpt

or using git for cloning the model you want to use:

git clone https://huggingface.co/Alpha-VLLM/Lumina-Next-T2I
  1. Setting your personal inference configuration

Update your own personal inference settings to generate different styles of images, checking config/infer/config.yaml for detailed settings. Detailed config structure:

/path/to/ckpt should be a directory containing consolidated*.pth and model_args.pth

- settings:

  model:
    ckpt: "/path/to/ckpt"           # if ckpt is "", you should use `--ckpt` for passing model path when using `lumina` cli.
    ckpt_lm: ""                     # if ckpt is "", you should use `--ckpt_lm` for passing model path when using `lumina` cli.
    token: ""                       # if LLM is a huggingface gated repo, you should input your access token from huggingface and when token is "", you should `--token` for accessing the model.

  transport:
    path_type: "Linear"             # option: ["Linear", "GVP", "VP"]
    prediction: "velocity"          # option: ["velocity", "score", "noise"]
    loss_weight: "velocity"         # option: [None, "velocity", "likelihood"]
    sample_eps: 0.1
    train_eps: 0.2

  ode:
    atol: 1e-6                      # Absolute tolerance
    rtol: 1e-3                      # Relative tolerance
    reverse: false                  # option: true or false
    likelihood: false               # option: true or false

  infer:
      resolution: "1024x1024"     # option: ["1024x1024", "512x2048", "2048x512", "(Extrapolation) 1664x1664", "(Extrapolation) 1024x2048", "(Extrapolation) 2048x1024"]
      num_sampling_steps: 60      # range: 1-1000
      cfg_scale: 4.               # range: 1-20
      solver: "euler"             # option: ["euler", "dopri5", "dopri8"]
      t_shift: 4                  # range: 1-20 (int only)
      ntk_scaling: true           # option: true or false
      proportional_attn: true     # option: true or false
      seed: 0                     # rnage: any number
  • model:
    • ckpt : lumina-next-t2i checkpoint path from huggingface repo containing consolidated*.pth and model_args.pth .
    • ckpt_lm : LLM checkpoint.
    • token : huggingface access token for accessing gated repo.
  • transport:
    • path_type : the type of path for transport: 'Linear', 'GVP' (Geodesic Vector Pursuit), or 'VP' (Vector Pursuit).
    • prediction : the prediction model for the transport dynamics.
    • loss_weight : the weighting of different components in the loss function, can be 'velocity' for dynamic modeling, 'likelihood' for statistical consistency, or None for no weighting
    • sample_eps : sampling in the transport model.
    • train_eps : training to stabilize the learning process.
  • ode:
    • atol : Absolute tolerance for the ODE solver. (options: ["Linear", "GVP", "VP"])
    • rtol : Relative tolerance for the ODE solver. (option: ["velocity", "score", "noise"])
    • reverse : run the ODE solver in reverse. (option: [None, "velocity", "likelihood"])
    • likelihood : Enable calculation of likelihood during the ODE solving process.
  • infer
    • resolution : generated image resolution.
    • num_sampling_steps : sampling step for generating image.
    • cfg_scale : classifier-free guide scaling factor
    • solver : solver for image generation.
    • t_shift : time shift factor.
    • ntk_scaling : ntk rope scaling factor.
    • proportional_attn : Whether to use proportional attention.
    • seed : random initialization seeds.
  1. Run with CLI

inference command:

lumina_next infer -c <config_path> <caption_here> <output_dir>

e.g. Demo command:

cd lumina_next_t2i
lumina_next infer -c "config/infer/settings.yaml" "a snowman of ..." "./outputs"
Web Demo

To host a local gradio demo for interactive inference, run the following command:

# `/path/to/ckpt` should be a directory containing `consolidated*.pth` and `model_args.pth`

# default
python -u demo.py --ckpt "/path/to/ckpt"

# the demo by default uses bf16 precision. to switch to fp32:
python -u demo.py --ckpt "/path/to/ckpt" --precision fp32 

# use ema model
python -u demo.py --ckpt "/path/to/ckpt" --ema

Runs of ckpt Lumina-Next-SFT on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About Lumina-Next-SFT huggingface.co Model

More Lumina-Next-SFT license Visit here:

https://choosealicense.com/licenses/apache-2.0

Lumina-Next-SFT huggingface.co

Lumina-Next-SFT huggingface.co is an AI model on huggingface.co that provides Lumina-Next-SFT's model effect (), which can be used instantly with this ckpt Lumina-Next-SFT model. huggingface.co supports a free trial of the Lumina-Next-SFT model, and also provides paid use of the Lumina-Next-SFT. Support call Lumina-Next-SFT model through api, including Node.js, Python, http.

Lumina-Next-SFT huggingface.co Url

https://huggingface.co/ckpt/Lumina-Next-SFT

ckpt Lumina-Next-SFT online free

Lumina-Next-SFT huggingface.co is an online trial and call api platform, which integrates Lumina-Next-SFT's modeling effects, including api services, and provides a free online trial of Lumina-Next-SFT, you can try Lumina-Next-SFT online for free by clicking the link below.

ckpt Lumina-Next-SFT online free url in huggingface.co:

https://huggingface.co/ckpt/Lumina-Next-SFT

Lumina-Next-SFT install

Lumina-Next-SFT is an open source model from GitHub that offers a free installation service, and any user can find Lumina-Next-SFT on GitHub to install. At the same time, huggingface.co provides the effect of Lumina-Next-SFT install, users can directly use Lumina-Next-SFT installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Lumina-Next-SFT install url in huggingface.co:

https://huggingface.co/ckpt/Lumina-Next-SFT

Url of Lumina-Next-SFT

Lumina-Next-SFT huggingface.co Url

Provider of Lumina-Next-SFT huggingface.co

ckpt
ORGANIZATIONS

Other API from ckpt

huggingface.co

Total runs: 6.0K
Run Growth: 556
Growth Rate: 9.31%
Updated:July 06 2023
huggingface.co

Total runs: 3.3K
Run Growth: -152
Growth Rate: -4.59%
Updated:January 31 2023
huggingface.co

Total runs: 1.1K
Run Growth: -182
Growth Rate: -16.90%
Updated:April 06 2023
huggingface.co

Total runs: 455
Run Growth: 227
Growth Rate: 50.90%
Updated:November 17 2024
huggingface.co

Total runs: 365
Run Growth: 264
Growth Rate: 72.33%
Updated:January 28 2023
huggingface.co

Total runs: 73
Run Growth: 58
Growth Rate: 79.45%
Updated:November 10 2023
huggingface.co

Total runs: 59
Run Growth: 40
Growth Rate: 67.80%
Updated:June 06 2024
huggingface.co

Total runs: 47
Run Growth: 17
Growth Rate: 36.17%
Updated:October 22 2023
huggingface.co

Total runs: 25
Run Growth: 7
Growth Rate: 28.00%
Updated:October 22 2023
huggingface.co

Total runs: 23
Run Growth: -20
Growth Rate: -86.96%
Updated:June 06 2024
huggingface.co

Total runs: 16
Run Growth: -15
Growth Rate: -93.75%
Updated:January 28 2023
huggingface.co

Total runs: 14
Run Growth: -11
Growth Rate: -78.57%
Updated:November 20 2023
huggingface.co

Total runs: 10
Run Growth: 4
Growth Rate: 40.00%
Updated:March 31 2023
huggingface.co

Total runs: 7
Run Growth: -2
Growth Rate: -25.00%
Updated:January 28 2023
huggingface.co

Total runs: 4
Run Growth: -2
Growth Rate: -50.00%
Updated:January 28 2023
huggingface.co

Total runs: 4
Run Growth: -1
Growth Rate: -25.00%
Updated:November 10 2023
huggingface.co

Total runs: 3
Run Growth: -2
Growth Rate: -66.67%
Updated:September 23 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 15 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 17 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 26 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 26 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 30 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 20 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 24 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 28 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 26 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:November 01 2022
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:July 27 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:May 04 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 04 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 26 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:May 19 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 14 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 24 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 14 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 24 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:August 08 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:May 13 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 14 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 26 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:May 07 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 24 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:June 08 2023