ml-stable-diffusion icon indicating copy to clipboard operation
ml-stable-diffusion copied to clipboard

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

Open jcm93 opened this issue 2 years ago • 7 comments

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!

jcm93 avatar Dec 18 '22 21:12 jcm93

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?

NekoNeko66 avatar Dec 19 '22 07:12 NekoNeko66

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.

jcm93 avatar Dec 19 '22 20:12 jcm93

Any updates on this.

jeet-dhandha avatar Dec 21 '22 02:12 jeet-dhandha

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

willdahlberg avatar Jan 05 '23 21:01 willdahlberg

Same here.

keyvez avatar Jan 31 '23 01:01 keyvez

+1

lucifer662607004 avatar Mar 05 '23 19:03 lucifer662607004

I ran into same issue. This is what I observed

  • Use locally converted models (as instructed in Converting Models to Core ML) , it runs without issue
  • Use downloaded compiled model, issue appears.

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

webdkt avatar Mar 22 '23 15:03 webdkt