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

Error running sd3.5 4bit quant using venv #44

Open
iamwavecut opened this issue Oct 29, 2024 · 2 comments
Open

Error running sd3.5 4bit quant using venv #44

iamwavecut opened this issue Oct 29, 2024 · 2 comments

Comments

@iamwavecut
Copy link

ive tred to run argmaxinc/mlx-stable-diffusion-3.5-large-4bit-quantized with no conda but using venv instead

I am using pinned Python 3.10 and Pytorch 2.4.0 versions to avoid compatibility issues.

python3.10 -m venv .venv
source .venv/bin/activate
pip install "torch==2.4.0" diffusionkit
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 'SD3 on \
DiffusionKit' glowing softly. High detail hard surface render" \
--model-version argmaxinc/mlx-stable-diffusion-3.5-large-4bit-quantized \
--height 768 \
--width 1360 \
--seed 1001 \
--step 50 \
--cfg 7 \
--t5 \
--output ~/Desktop/sd3_on_mac.png
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
INFO:diffusionkit.mlx:Post text encoding peak memory: 2.628GB
INFO:diffusionkit.mlx:Post text encoding active memory: 1.786GB
INFO:diffusionkit.mlx:Text encoding time: 2.235s
INFO:diffusionkit.mlx:Pre denoise peak memory: 0.0GB
INFO:diffusionkit.mlx:Pre denoise active memory: 0.018GB
INFO:diffusionkit.mlx:Seed: 1001
  0%|                                                                                                                                                                                      | 0/50 [00:00<?, ?it/s]Traceback (most recent call last):
  File "/Users/wavecut/Downloads/diffusionkit/.venv/bin/diffusionkit-cli", line 8, in <module>
    sys.exit(cli())
  File "/Users/wavecut/Downloads/diffusionkit/.venv/lib/python3.10/site-packages/diffusionkit/mlx/scripts/generate_images.py", line 174, in cli
    image, _ = sd.generate_image(
  File "/Users/wavecut/Downloads/diffusionkit/.venv/lib/python3.10/site-packages/diffusionkit/mlx/__init__.py", line 421, in generate_image
    latents, iter_time = self.denoise_latents(
  File "/Users/wavecut/Downloads/diffusionkit/.venv/lib/python3.10/site-packages/diffusionkit/mlx/__init__.py", line 286, in denoise_latents
    latent, iter_time = sample_euler(
  File "/Users/wavecut/Downloads/diffusionkit/.venv/lib/python3.10/site-packages/diffusionkit/mlx/__init__.py", line 772, in sample_euler
    model.cache_modulation_params(extra_args.pop("pooled_conditioning"), timesteps)
  File "/Users/wavecut/Downloads/diffusionkit/.venv/lib/python3.10/site-packages/diffusionkit/mlx/__init__.py", line 682, in cache_modulation_params
    self.model.mmdit.cache_modulation_params(
  File "/Users/wavecut/Downloads/diffusionkit/.venv/lib/python3.10/site-packages/diffusionkit/mlx/mmdit.py", line 177, in cache_modulation_params
    logger.info(f"Cached modulation_params for timesteps={timesteps}")
TypeError: unsupported format string passed to mx.array.__format__
  0%| 
@arda-argmax
Copy link
Collaborator

Hello,

It seems the latest version of mlx is incompatible with our diffusionkit release. We will release a fix for this in the coming days. In the interim, can you try installing this version of mlx:

pip install mlx==0.17.3

@iamwavecut
Copy link
Author

iamwavecut commented Oct 30, 2024

Yeah, that worked, feel free to close the issue once fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants