When attempting to run the program, it fails with the following error:
~/repo/mlx-examples/stable_diffusion/image2image.py", line 72, in <module>
im = Image.fromarray(x.__array__())
^^^^^^^^^^^
AttributeError: 'mlx.core.array' object has no attribute '__array__'
To correct this issue, make the following changes:
# Original code
# im = Image.fromarray(x.__array__())
# Updated code
# im = Image.fromarray(x.__array__()) # Commenting out the original line
im = Image.fromarray(np.array(x)) # Converting the 'mlx.core.array' object to a NumPy array before passing to Image.fromarray
im.save(args.output)
When attempting to run the program, it fails with the following error:
To correct this issue, make the following changes: