Closed SystemKeeper closed 10 months ago
Thanks for the report! We explicitly check in process_prompt that a provider is available so this is likely not an issue in the text2image_helper, per se. Digging deeper on Manager.php makes me wonder if the array key can be assumed to be 0 in https://github.com/nextcloud/server/blob/6fa377e90e269b1610aab2b40bba3e3ab78f0b4b/lib/private/TextToImage/Manager.php#L231C4-L232C24. Looking at the getProviders() source code it seems like sometimes the array keys may be the class strings so we should do array_values() or array_shift() get the first provider in the Manager.php, maybe? Wdyt, @marcelklehr ?
... and the downloaded models for text2image_stablediffusion should be ~13gb, IIRC, if everything went fine (I was never able to automatically download the models using the text2image_stablediffusion cli command, for whatever reason.)
should be ~13gb, IIRC
Yep, after re-trying the download it was about that size. But checking again today:
root@nextcloud:/var/www/nextcloud# du -sh apps/text2image_stablediffusion/
453M apps/text2image_stablediffusion/
Not sure what happend here, I'll take a look later
I think my suspicion from above is correct. So the reason we didn't catch this while testing these apps with Marcel is likely that the 0 key is defined if the text2image provider is explicitly chosen in the settings. In this case the json decoded id of the selected provider is used in Manager::getPreferredProviders() as a filter and [$provider] is returned. We would have played around with the settings repeatedly while testing these apps with Marcel so we didn't notice that $providers with the class strings as keys is passed through if the user has not explicitly selected the provider in the settings before. AFAICT this requires a PR for server repo to fix.
(You should be able to quickly work around this issue by toggling the default provider for this task type under artificial intelligence settings.)
I suppose the fix could be as simple as this: https://github.com/nextcloud/server/tree/fix/text-to-image-manager
Thanks a lot, I'll test this later!
I am now downloading the models for the third time :-( It downloads successfully (the folder is roughly 13GB), but after a while, the folder is only 430 MB in size. Could not finding of a provider lead to a deletion of the model? Sorry, might even be totally unrelated to this issue, but it's weird. I received "Successful" in all cases:
# su - www-data -s /bin/bash -c 'php8.2 -d display_errors=stderr /var/www/nextcloud/occ text2image_stablediffusion:download-models'
Downloading models
Successful
🤔
Updating the app removes the models
Updating the app removes the models
But I did not update anything? This morning I
after returning to this, the model vanished. I'll try again, to be sure
I guess the issue is this: https://github.com/nextcloud/text2image_stablediffusion/issues/5
NC 28.0.1
Installed:
In the admin settings everything is green. At first I thought its because the downloaded model had only 400MB, but after re-downloading the model, the same error still exists.