not run

#6
by sdyy - opened

Pipeline for Flux

from diffusionkit.mlx import FluxPipeline

pipeline = FluxPipeline(
shift=1.0,
model_version="argmaxinc/mlx-FLUX.1-schnell-4bit-quantized",
low_memory_mode=True,
a16=True,
w16=True,
)

HEIGHT = 512
WIDTH = 512
NUM_STEPS = 4
CFG_WEIGHT = 0

image, _ = pipeline.generate_image(
"a photo of a cat",
cfg_weight=CFG_WEIGHT,
num_steps=NUM_STEPS,
latent_size=(HEIGHT // 8, WIDTH // 8),
)

WARNING:coremltools:Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'
WARNING:coremltools:Failed to load _MLModelAssetProxy: No module named 'coremltools.libcoremlpython'
WARNING:coremltools:Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'
WARNING:coremltools:Failed to load _MLCPUComputeDeviceProxy: No module named 'coremltools.libcoremlpython'
WARNING:coremltools:Failed to load _MLGPUComputeDeviceProxy: No module named 'coremltools.libcoremlpython'
WARNING:coremltools:Failed to load _MLNeuralEngineComputeDeviceProxy: No module named 'coremltools.libcoremlpython'
WARNING:coremltools:Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'
WARNING:coremltools:Failed to load _MLComputePlanProxy: No module named 'coremltools.libcoremlpython'
/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_auth.py:94: UserWarning:
The secret HF_TOKEN does not exist in your Colab secrets.
To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.
You will be able to reuse this secret in all of your notebooks.
Please note that authentication is recommended but still optional to access public models or datasets.
warnings.warn(
INFO:diffusionkit.mlx:Pre text encoding peak memory: 0.0GB
INFO:diffusionkit.mlx:Pre text encoding active memory: 0.0GB

!diffusionkit-cli
--prompt "detailed cinematic dof render of a detailed MacBook Pro on a wooden desk in a dim room with items around, messy dirty room. On the screen are the letters 'FLUX on DiffusionKit' glowing softly. High detail hard surface render"
--model-version argmaxinc/mlx-FLUX.1-schnell-4bit-quantized
--height 768
--width 1360
--seed 1001
--step 4
--output /content/flux_on_mac.png

XGBoost version 2.1.2 has not been tested with coremltools. You may run into unexpected errors. XGBoost 1.4.2 is the most recent version that has been tested.
2024-11-27 03:30:33.588606: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:485] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-11-27 03:30:33.608866: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:8454] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-11-27 03:30:33.614884: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1452] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-11-27 03:30:34.866421: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
TensorFlow version 2.17.1 has not been tested with coremltools. You may run into unexpected errors. TensorFlow 2.12.0 is the most recent version that has been tested.
Torch version 2.5.1+cu121 has not been tested with coremltools. You may run into unexpected errors. Torch 2.4.0 is the most recent version that has been tested.
Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLModelAssetProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLCPUComputeDeviceProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLGPUComputeDeviceProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLNeuralEngineComputeDeviceProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLComputePlanProxy: No module named 'coremltools.libcoremlpython'
WARNING:diffusionkit.mlx.scripts.generate_images:Disabling CFG for argmaxinc/mlx-FLUX.1-schnell-4bit-quantized model.
flux-schnell-4bit-quantized.safetensors: 100% 6.69G/6.69G [02:40<00:00, 41.8MB/s]
config.json: 100% 45.0/45.0 [00:00<00:00, 234kB/s]
ae.safetensors: 100% 335M/335M [00:07<00:00, 42.2MB/s]
clip_l/config.json: 100% 565/565 [00:00<00:00, 2.92MB/s]
model.fp16.safetensors: 100% 246M/246M [00:05<00:00, 42.0MB/s]
tokenizer_l/vocab.json: 100% 1.06M/1.06M [00:00<00:00, 8.22MB/s]
tokenizer_l/merges.txt: 100% 525k/525k [00:00<00:00, 21.7MB/s]
config.json: 100% 593/593 [00:00<00:00, 3.35MB/s]
t5xxl.safetensors: 100% 9.79G/9.79G [03:53<00:00, 42.0MB/s]
tokenizer_config.json: 100% 1.86k/1.86k [00:00<00:00, 11.0MB/s]
spiece.model: 100% 792k/792k [00:00<00:00, 6.15MB/s]
special_tokens_map.json: 100% 1.79k/1.79k [00:00<00:00, 10.5MB/s]
INFO:diffusionkit.mlx.scripts.generate_images:Output image resolution will be 768x1360
INFO:diffusionkit.mlx:Pre text encoding peak memory: 0.0GB
INFO:diffusionkit.mlx:Pre text encoding active memory: 0.0GB
terminate called after throwing an instance of 'std::runtime_error'
what(): [Matmul::eval_cpu] Currently only supports float32.

@sdyy could you give me more information about your Python environment? I just tested this checkpoint (removed it from .cache before as well)

conda create -n diffusionkit python=3.11 -y && conda activate diffusionkit
git clone https://github.com/argmaxinc/DiffusionKit.git && cd DiffusionKit
pip install -e .
diffusionkit-cli --prompt "a cat" --model-version argmaxinc/mlx-FLUX.1-schnell-4bit-quantized --steps 4 --height 768 --width 1360

and got this output
out.png

Sign up or log in to comment