This custom node integrates the Lumina-mGPT model into ComfyUI, enabling high-quality image generation using the advanced Lumina text-to-image pipeline. It offers a robust implementation with support for various model sizes and advanced features, including improved latent space handling and flexible crop sizes.
- Harnesses the power of the Lumina-mGPT model for state-of-the-art image generation
- Supports multiple model sizes: 512, 768, 768-Omni, and 1024
- Offers a range of generation parameters for fine-tuned control
- Implements Lumina-specific features including cfg-scale and image top-k sampling
- Automatic model downloading for seamless setup
- Outputs both generated images and latent representations
- Includes a converter node for ComfyUI compatibility
- Provides a decoder node for latent-to-image conversion
- Improved latent space handling for better compatibility with ComfyUI
- Flexible crop sizes with automatic adjustment to valid dimensions
- Enhanced error handling and logging for easier troubleshooting
Since the Chameleon implementation in transformers does not contain the VQ-VAE decoder, please manually download the original VQ-VAE weights provided by Meta and place them in the following directory:
NOTE: I've added the files to the respective path however they will need to be extracted from the zip file before running the node.
Lumina-mGPT
- lumina_mgpt/
- ckpts/
- chameleon/
- tokenizer/
- text_tokenizer.json
- vqgan.yaml
- vqgan.ckpt
- xllmx/
- ...
You can download the required files from Meta's Chameleon Downloads.
-
Ensure you have ComfyUI installed and properly set up.
-
Clone this repository into your ComfyUI custom nodes directory:
git clone https://github.com/Excidos/ComfyUI-Lumina-mGPT-Wrapper.git
-
The required dependencies will be automatically installed.
-
If you are having trouble you may have to install XLLMX independently but copying the path of your python_embedded python.exe and running in the Lumina-mGPT directory
cd Lumina_mGPT
"Path to your embedded python.exe" pip -m install -e .
- Launch ComfyUI.
- Locate the "Load Lumina-mGPT Model" node in the node selection menu.
- Add the node to your workflow and connect it to a "Lumina-mGPT Image Generate" node.
- (Optional) Use the "Lumina-mGPT Crop Selector" to choose a specific resolution.
- Configure the node parameters as desired.
- Connect the output to either a "Lumina-mGPT Converter" or "Lumina-mGPT Decoder" node for further processing or display.
- Execute your workflow to generate images.
model
: Choose from available model sizes (512, 768, 768-Omni, 1024)precision
: Select precision (bf16 or fp32)
target_size
: Select from 512, 768, or 1024aspectRatio
: Choose from various aspect ratios (1:1, 4:3, 16:9, etc.)crop_size
: Select from a list of valid crop sizes or "None" for automatic selection
lumina_mgpt_model
: Connected from the Load Lumina-mGPT Model nodeprompt
: Text prompt for image generationresolution
: Image resolution (can be connected from Crop Selector)cfg
: Classifier-free guidance scaleseed
: Random seed for generation (0 for random)image_top_k
: Top-k sampling parameter for image generationtemperature
: Controls randomness in generation
image
: Input image to convert to ComfyUI-compatible format
latent
: Input latent representation to decode into an imageoutput_type
: Choose between "IMAGE" or "LATENT" output
IMAGE
: Generated or decoded imageLATENT
: Latent representation of the generated image
- Supports multiple model sizes for different use cases
- Implements cfg and image top-k parameters for controlling the generation process
- Outputs both images and latent representations
- Includes converter and decoder nodes for enhanced compatibility and flexibility
- Improved latent space handling ensures better compatibility with ComfyUI's expectations
- Automatic adjustment of crop sizes to valid dimensions for each model size
- Enhanced error handling and logging for easier troubleshooting and debugging
If you encounter any issues, please check the console output for error messages. Common issues include:
- Insufficient GPU memory
- Missing dependencies
- Incorrect model or tokenizer path
For further assistance, please open an issue on the GitHub repository.
Contributions are welcome! Please feel free to submit a Pull Request.
- Lumina-mGPT for the Lumina-mGPT model
- The ComfyUI community for their continuous support and inspiration
- Meta for providing the Chameleon VQ-VAE weights