ShiftHackZ / Stable-Diffusion-Android

Stable Diffusion AI client app for Android
https://sdai.moroz.cc
GNU Affero General Public License v3.0
534 stars 56 forks source link

Can't load custom models #169

Open Antonio225t opened 2 months ago

Antonio225t commented 2 months ago

Describe the bug When I place a safetensor model in Download/SDAi/model, it does not appear inside the app. I can see the models that I can download from the app but I can't use custom models, and when I check for the downloaded model from the app in Download/SDAi/model I can't find it anywhere. Is that the correct path? If not what's the correct path? I am not allowed to go in Android/data or other paths, so I hope it's not one of them.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Local Diffusion (Beta)'
  2. Click on 'Load custom model'
  3. Go to 'Custom'
  4. Click on 'Submit'
  5. See a 'Custom' text and not the custom model one

Expected behavior Instead of the 'Custom' text in 'SD Model', it should appear something like the name of the custom model that it's going to be loaded I guess. Or something that makes me understand that the safetensor is running.

Screenshots I don't have any screenshots :(

Smartphone (please complete the following information):

Additional context Is that the wrong path or is there something wrong with the app? Thanks in advance 👍.

KintCark commented 2 months ago

No u go to huggingface.co go to search bar type android then look in list you will see an androidonnxfork/test click that name then look for file that ends in ort click that folder then u pick what model u want then go in each 4 folders textDecoder,Tokinizer,unet,amd vaeDecoder, download model.ort out of the 3 folders and download all the files out of tokinizer then recreate the 4 folders on your phones storage put each model back its corresponding folder like e ample:text Decoder model.ort goes in text Decoder folder., like that. U are useing the wrong models saftensor isn't supported yet.

mgxhhg commented 2 months ago

@KintCark What he said may actually be that the model cannot be detected on Android 14. Look at this, all the files have been imported, but they are still not detected.

https://github.com/ShiftHackZ/Stable-Diffusion-Android/assets/97750654/ddd15c56-c504-4c2b-a051-eaded24e21ff

KintCark commented 2 months ago

@KintCark What he said may actually be that the model cannot be detected on Android 14. Look at this, all the files have been imported, but they are still not detected.

https://github.com/ShiftHackZ/Stable-Diffusion-Android/assets/97750654/ddd15c56-c504-4c2b-a051-eaded24e21ff

No delete the onnx files out the folders you only need model.ort

mgxhhg commented 2 months ago

@KintCark But taking this file list as an example, there is no model.onnx folder in it. I have tried to load all the files now, but they still cannot be detected.

Screenshot_2024-04-06-12-07-44-546_com android settings Screenshot_2024-04-06-12-04-38-362_com android chrome

KintCark commented 2 months ago

@KintCark But taking this file list as an example, there is no model.onnx folder in it. I have tried to load all the files now, but they still cannot be detected.

Screenshot_2024-04-06-12-07-44-546_com android settings Screenshot_2024-04-06-12-04-38-362_com android chrome

Idk maybe it is android 14..... hopefully Shift will fix it

mgxhhg commented 2 months ago

@ ShiftHackZ

Antonio225t commented 2 months ago

No u go to huggingface.co go to search bar type android then look in list you will see an androidonnxfork/test click that name then look for file that ends in ort click that folder then u pick what model u want then go in each 4 folders textDecoder,Tokinizer,unet,amd vaeDecoder, download model.ort out of the 3 folders and download all the files out of tokinizer then recreate the 4 folders on your phones storage put each model back its corresponding folder like e ample:text Decoder model.ort goes in text Decoder folder., like that. U are useing the wrong models saftensor isn't supported yet.

Will safetensor be supported in the future? If not, how can I convert a safetensor in this .ort format? Thanks in advance 👍.

KintCark commented 2 months ago

No u go to huggingface.co go to search bar type android then look in list you will see an androidonnxfork/test click that name then look for file that ends in ort click that folder then u pick what model u want then go in each 4 folders textDecoder,Tokinizer,unet,amd vaeDecoder, download model.ort out of the 3 folders and download all the files out of tokinizer then recreate the 4 folders on your phones storage put each model back its corresponding folder like e ample:text Decoder model.ort goes in text Decoder folder., like that. U are useing the wrong models saftensor isn't supported yet.

Will safetensor be supported in the future? If not, how can I convert a safetensor in this .ort format? Thanks in advance 👍.

Idk I tried it my self but it can't run on weak pc I need more vram but you gota install visual studio and onnx runtime