apple / ml-stable-diffusion

Stable Diffusion with Core ML on Apple Silicon
MIT License
16.46k stars 886 forks source link

-[NSNull featureNames]: unrecognized selector under stable-diffusion-2 #74

Open jcm93 opened 1 year ago

jcm93 commented 1 year ago

Hi, I've been compiling and using the project casually with the default model. I tried it with stabilityai/stable-diffusion-2 today and all went well, until actual image generation with Swift. Here's the output:

% swift run StableDiffusionSample "test" --resource-path mlpackages/Resources/ --seed 93 --output-path images                                                                                              
Building for debugging...
Build complete! (0.08s)
Loading resources and creating pipeline
(Note: This can take a while the first time using these resources)
Step 50 of 50  [mean: 0.67, median: 0.67, last 0.69] step/sec
2022-12-18 14:26:19.638 StableDiffusionSample[41479:1978665] Error calling plan_submit in batch processing.
2022-12-18 14:26:19.638 StableDiffusionSample[41479:1977234] -[NSNull featureNames]: unrecognized selector sent to instance 0x1dd3b6810
zsh: trace trap  swift run StableDiffusionSample "test" --resource-path  --seed 93

It seemingly generates the image just fine, but runs into issues at the very end. Let me know if there are any further steps I can take to help debug!

NekoNeko66 commented 1 year ago

Maybe you can try to run this code in Xcode with the debugger attached. That way, it will show the line that crashed (if it was within one of the package files).

Also, maybe try disable the safety check?

jcm93 commented 1 year ago

Hmm, do you know a good way to run this in the Xcode debugger? The repo doesn't arrive with an xcodeproj and I don't know the incantations to attach lldb to a swift run type of process.

jeet-dhandha commented 1 year ago

Any updates on this.

willdahlberg commented 1 year ago

I'm hitting this. Looking for a solution as well.

keyvez commented 1 year ago

Same here.

lucifer662607004 commented 1 year ago

+1

webdkt commented 1 year ago

I ran into same issue. This is what I observed

My guess, something to do with compile environment (I recently upgraded MacOS/XCode etc). Locally converted models should be OK