Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background Process during image generation #219

Open
mtribiere opened this issue Aug 4, 2024 · 9 comments
Open

Background Process during image generation #219

mtribiere opened this issue Aug 4, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@mtribiere
Copy link

Is your feature request related to a problem? Please describe.
During generation of an image, switching to another app or locking the phone is not possible.

Describe the solution you'd like
The ideal solution in my sense would be to have the process happening in a background process.
A permanent notification could indicate the progress of the generation process.

Describe alternatives you've considered
Leaving the phone on and focus on the app, but it's necessary a "convenient" solution.

Additional context
N/A

@PurpleCodingWizard
Copy link

Yeah, I too experience this issue. The app gets killed unless I keep it in foeground with my display turned on.

@ShiftHackZ
Copy link
Owner

Thanks for reporting this important issue.

I think implementing generation as a background process using Work Manager API that is recommended by Google for background work should resolve this.

Could you please also provide some additional information related to your user experience:

  • What generation provider(s) do you use ?
  • How much time does the generation process take (with the workaround you've considered) ?

@ShiftHackZ ShiftHackZ self-assigned this Aug 6, 2024
@ShiftHackZ ShiftHackZ added the bug Something isn't working label Aug 6, 2024
@mtribiere
Copy link
Author

I use the local generation provider, so it runs pretty slowly. I would say it takes 4~5 minutes per images for me

@ShiftHackZ ShiftHackZ linked a pull request Aug 8, 2024 that will close this issue
4 tasks
@dragos240
Copy link

My phone (Asus Zenfone 10) seems to kill the app even if I run it in the foreground. I'm not sure how to disable this behavior. I have battery restrictions disabled for this app, but I'm not sure anything else I can do to prevent my phone from killing the process. I think it must have to do with the OS thinking it's using too much resources and killing it. Not sure what to do to resolve this. If anyone has any tips, I would greatly appreciate them.

@ShiftHackZ
Copy link
Owner

My phone (Asus Zenfone 10) seems to kill the app even if I run it in the foreground. I'm not sure how to disable this behavior. I have battery restrictions disabled for this app, but I'm not sure anything else I can do to prevent my phone from killing the process. I think it must have to do with the OS thinking it's using too much resources and killing it. Not sure what to do to resolve this. If anyone has any tips, I would greatly appreciate them.

Please try to disable battery optimizations for the app specifically (see the screenshot).
Maybe it's worth checking if your manufacturer (Asus) added some additional battery optimization settings in their Android ROM, if you have any additional settings, try also disable them.

image

If it does not help, wait for the next 0.6.3 release, it will include Background generation feature in app settings that is based on Android Work Manager API, maybe this implementation will work better on your device.

@PurpleCodingWizard
Copy link

PurpleCodingWizard commented Aug 9, 2024

Sorry for late reply. I just saw your comment in the spam while looking for important communication in all folders.

I think implementing generation as a background process using Work Manager API that is recommended by Google for background work should resolve this.

Great, hopefully android doesn't kill SDAI Foss now.

Could you please also provide some additional information related to your user experience:

* What generation provider(s) do you use ?

I use the local version.

* How much time does the generation process take (with the workaround you've considered) ?

Depends on the image size and steps(20) but 7-10mins on average if I go 384x384 and higher.
I usually keep the app in a floating window until SDAI gets started on the processing steps after which its usually safe (but not guranteed) to be switched to background in addition to locking the app to further reduce the possibility of being killed.

@dragos240
Copy link

My phone (Asus Zenfone 10) seems to kill the app even if I run it in the foreground. I'm not sure how to disable this behavior. I have battery restrictions disabled for this app, but I'm not sure anything else I can do to prevent my phone from killing the process. I think it must have to do with the OS thinking it's using too much resources and killing it. Not sure what to do to resolve this. If anyone has any tips, I would greatly appreciate them.

Please try to disable battery optimizations for the app specifically (see the screenshot). Maybe it's worth checking if your manufacturer (Asus) added some additional battery optimization settings in their Android ROM, if you have any additional settings, try also disable them.

image

If it does not help, wait for the next 0.6.3 release, it will include Background generation feature in app settings that is based on Android Work Manager API, maybe this implementation will work better on your device.

I have tried everything that I was able to find on my phone and the app's setting. Everything is set to unrestricted, but my phone still kills the app. So I will wait to see if the next release fixes things

@KintCark
Copy link

KintCark commented Aug 9, 2024

U don't have enough ram the app used to do the same to me on 512x512 u can download swap file no root app from Google Play store it will help with ram issues. I just factory reset my phone and it frees up the most ram, after u factory reset it don't install to many apps the more apps you have the more ram is used.

@PurpleCodingWizard
Copy link

U don't have enough ram the app used to do the same to me on 512x512 u can download swap file no root app from Google Play store it will help with ram issues.

You cannot create a swap file without root on android. That app is a literal scam. All it does is create a blank file in its data folder hogging storage which does nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants