Skip to content

Commit 0835019

Browse files
committed
feat: rebrand SDAI to PDAI (Pocket Diffusion)
1 parent 3ce4749 commit 0835019

1,606 files changed

Lines changed: 13229 additions & 13074 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@ShiftHackZ
1+
@crim50n

.github/FUNDING.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
1-
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
2-
patreon: # Replace with a single Patreon username
3-
open_collective: # Replace with a single Open Collective username
4-
ko_fi: # Replace with a single Ko-fi username
5-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
6-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
7-
liberapay: # Replace with a single Liberapay username
8-
issuehunt: # Replace with a single IssueHunt username
9-
otechie: # Replace with a single Otechie username
10-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
11-
custom: ['https://www.buymeacoffee.com/shifthackz', 'https://send.monobank.ua/jar/3n2Aj3Hv3g']
1+
# Funding links removed

README.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
![Header](docs/assets/github-header-image.png)
1+
![Header](docs/assets/tlogo_256.png)
22

3-
# Stable-Diffusion-Android (SDAI)
3+
# Pocket Diffusion Android (PDAI)
44

5-
![Google Play](https://img.shields.io/endpoint?color=blue&logo=google-play&logoColor=white&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dcom.shifthackz.aisdv1.app%26l%3DGoogle%2520Play%26m%3D%24version)
6-
![F-Droid](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Ff-droid.org%2Fapi%2Fv1%2Fpackages%2Fcom.shifthackz.aisdv1.app.foss&query=%24.packages%5B0%5D.versionName&label=F-Droid&link=https%3A%2F%2Ff-droid.org%2Fpackages%2Fcom.shifthackz.aisdv1.app.foss%2F)
5+
[![GitHub](https://img.shields.io/github/v/release/crim50n/Pocket-Diffusion-Android?label=GitHub)](https://github.com/crim50n/Pocket-Diffusion-Android/releases)
76

8-
9-
[![Google Play](docs/assets/google_play.png)](https://play.google.com/store/apps/details?id=com.shifthackz.aisdv1.app)
10-
[![F-Droid](docs/assets/fdroid.png)](https://f-droid.org/packages/com.shifthackz.aisdv1.app.foss)
11-
[![4pda](docs/assets/4pda.png)](https://4pda.to/forum/index.php?showtopic=1082639)
12-
13-
Stable Diffusion AI (SDAI) is an easy-to-use app that:
7+
Pocket Diffusion (PDAI) is an easy-to-use app that:
148

159
- Brings you the power of digital art creativity with Stable Diffusion AI
1610
- Gives you freedom to choose your AI generation provider
@@ -71,7 +65,7 @@ Stable Diffusion AI (SDAI) is an easy-to-use app that:
7165
- Active SD Model selection
7266
- Server availability monitoring (http-ping method)
7367
- Enable/Disable auto-saving of generated images
74-
- Enable/Disable saving generated images to `Download/SDAI` android MediaStore folder
68+
- Enable/Disable saving generated images to `Download/PDAI` android MediaStore folder
7569
- Optimized file-based media storage (faster loading and reduced memory usage)
7670
- Clear gallery / app cache
7771

@@ -190,14 +184,10 @@ Any contributions to the translations are welcome.
190184

191185
## Difference between build flavors (Google Play, F-Droid, GitHub releases)
192186

193-
There are some reasons that some of the SDAI app features can not be distributed through different sources (Google Play, F-Droid) because of rules and compliance policies.
194-
195-
The difference between SDAI app flavors are described at the project wiki page [Build flavor difference](https://github.com/ShiftHackZ/Stable-Diffusion-Android/wiki/Build-flavor-difference).
196-
197-
## Donate
187+
There are some reasons that some of the PDAI app features can not be distributed through different sources (Google Play, F-Droid) because of rules and compliance policies.
198188

199-
This software is open source, provided with no warranty, and you are welcome to use it for free.
189+
The difference between PDAI app flavors are described at the project wiki page [Build flavor difference](https://github.com/crim50n/Pocket-Diffusion-Android/wiki/Build-flavor-difference).
200190

201-
In case you find this software valuable, and you'd like to say thanks and show a little support, here is the button:
191+
## Credits
202192

203-
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/shifthackz)
193+
This project is a fork of [Stable Diffusion Android](https://github.com/ShiftHackZ/Stable-Diffusion-Android) by [ShiftHackZ](https://github.com/ShiftHackZ), licensed under GNU AGPL v3.0.

app/build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
android {
11-
namespace = "com.shifthackz.aisdv1.app"
11+
namespace = "dev.minios.pdaiv1.app"
1212

1313
dependenciesInfo {
1414
includeInApk = false
@@ -23,7 +23,7 @@ android {
2323
}
2424

2525
defaultConfig {
26-
applicationId = "com.shifthackz.aisdv1.app"
26+
applicationId = "dev.minios.pdaiv1.app"
2727
versionName = libs.versions.versionName.get()
2828
versionCode = libs.versions.versionCode.get().toInt()
2929

@@ -40,12 +40,12 @@ android {
4040
buildConfigField("String", "OPEN_AI_INFO_URL", "\"https://platform.openai.com/api-keys\"")
4141
buildConfigField("String", "STABILITY_AI_INFO_URL", "\"https://platform.stability.ai/\"")
4242
buildConfigField("String", "FAL_AI_INFO_URL", "\"https://fal.ai/dashboard/keys\"")
43-
buildConfigField("String", "UPDATE_API_URL", "\"https://sdai.moroz.cc\"")
44-
buildConfigField("String", "REPORT_API_URL", "\"https://sdai-report.moroz.cc\"")
45-
buildConfigField("String", "DEMO_MODE_API_URL", "\"https://sdai.moroz.cc\"")
46-
buildConfigField("String", "POLICY_URL", "\"https://sdai.moroz.cc/policy.html\"")
47-
buildConfigField("String", "DONATE_URL", "\"https://www.buymeacoffee.com/shifthackz\"")
48-
buildConfigField("String", "GITHUB_SOURCE_URL", "\"https://github.com/ShiftHackZ/Stable-Diffusion-Android\"")
43+
buildConfigField("String", "UPDATE_API_URL", "\"https://pdai.minios.dev\"")
44+
buildConfigField("String", "REPORT_API_URL", "\"https://pdai.minios.dev\"")
45+
buildConfigField("String", "DEMO_MODE_API_URL", "\"https://pdai.minios.dev\"")
46+
buildConfigField("String", "POLICY_URL", "\"https://pdai.minios.dev/policy.html\"")
47+
buildConfigField("String", "DONATE_URL", "\"\"")
48+
buildConfigField("String", "GITHUB_SOURCE_URL", "\"https://github.com/crim50n/Pocket-Diffusion-Android\"")
4949
buildConfigField("String", "SETUP_INSTRUCTIONS_URL", "\"https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki\"")
5050
buildConfigField("String", "SWARM_UI_INFO_URL", "\"https://github.com/mcmonkeyprojects/SwarmUI/tree/master/docs\"")
5151

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<uses-native-library android:name="libOpenCL-pixel.so" android:required="false" />
1818

1919
<activity
20-
android:name="com.shifthackz.aisdv1.presentation.activity.AiStableDiffusionActivity"
20+
android:name="dev.minios.pdaiv1.presentation.activity.AiStableDiffusionActivity"
2121
android:exported="true"
2222
android:launchMode="singleInstance"
2323
android:screenOrientation="portrait"
73.5 KB
Loading

app/src/main/java/com/shifthackz/aisdv1/app/AiStableDiffusionClientApp.kt

Lines changed: 0 additions & 97 deletions
This file was deleted.

app/src/main/java/com/shifthackz/aisdv1/app/di/FeatureModule.kt

Lines changed: 0 additions & 13 deletions
This file was deleted.

app/src/main/java/com/shifthackz/aisdv1/app/di/PreferenceModule.kt

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
package dev.minios.pdaiv1.app
2+
3+
import android.annotation.SuppressLint
4+
import android.app.Application
5+
import android.database.CursorWindow
6+
import android.os.StrictMode
7+
import android.os.StrictMode.VmPolicy
8+
import androidx.work.Configuration
9+
import androidx.work.WorkManager
10+
import dev.minios.pdaiv1.app.di.featureModule
11+
import dev.minios.pdaiv1.app.di.preferenceModule
12+
import dev.minios.pdaiv1.app.di.providersModule
13+
import dev.minios.pdaiv1.core.common.log.FileLoggingTree
14+
import dev.minios.pdaiv1.core.common.log.errorLog
15+
import dev.minios.pdaiv1.core.imageprocessing.di.imageProcessingModule
16+
import dev.minios.pdaiv1.core.notification.di.notificationModule
17+
import dev.minios.pdaiv1.core.validation.di.validatorsModule
18+
import dev.minios.pdaiv1.data.di.dataModule
19+
import dev.minios.pdaiv1.demo.di.demoModule
20+
import dev.minios.pdaiv1.domain.di.domainModule
21+
import dev.minios.pdaiv1.network.di.networkModule
22+
import dev.minios.pdaiv1.presentation.di.presentationModule
23+
import dev.minios.pdaiv1.storage.di.databaseModule
24+
import dev.minios.pdaiv1.work.di.SdaiWorkerFactory
25+
import dev.minios.pdaiv1.work.di.backgroundWorkModule
26+
import org.koin.android.ext.android.inject
27+
import org.koin.android.ext.koin.androidContext
28+
import org.koin.core.context.startKoin
29+
import timber.log.Timber
30+
31+
class AiStableDiffusionClientApp : Application() {
32+
33+
override fun onCreate() {
34+
super.onCreate()
35+
StrictMode.setVmPolicy(VmPolicy.Builder().build())
36+
Thread.currentThread().setUncaughtExceptionHandler { _, t -> errorLog(t) }
37+
initializeKoin()
38+
initializeLogging()
39+
initializeCursorSize()
40+
initializeWorkManager()
41+
}
42+
43+
/**
44+
* Overrides the cursor size to prevent Room DB fail with big base64.
45+
*
46+
* Reference: https://stackoverflow.com/questions/51959944/sqliteblobtoobigexception-row-too-big-to-fit-into-cursorwindow-requiredpos-0-t
47+
*/
48+
@SuppressLint("DiscouragedPrivateApi")
49+
private fun initializeCursorSize() {
50+
try {
51+
val field = CursorWindow::class.java.getDeclaredField("sCursorWindowSize")
52+
field.isAccessible = true
53+
field.set(null, 100 * 1024 * 1024) // 100 Mb
54+
} catch (e: Exception) {
55+
errorLog(e)
56+
}
57+
}
58+
59+
private fun initializeKoin() = startKoin {
60+
androidContext(this@AiStableDiffusionClientApp)
61+
modules(
62+
notificationModule,
63+
demoModule,
64+
*featureModule,
65+
preferenceModule,
66+
providersModule,
67+
*domainModule,
68+
*dataModule,
69+
backgroundWorkModule,
70+
networkModule,
71+
databaseModule,
72+
validatorsModule,
73+
imageProcessingModule,
74+
*presentationModule,
75+
)
76+
}
77+
78+
private fun initializeLogging() {
79+
if (BuildConfig.DEBUG) {
80+
Timber.plant(Timber.DebugTree())
81+
}
82+
Timber.plant(FileLoggingTree())
83+
}
84+
85+
private fun initializeWorkManager() {
86+
try {
87+
val workerFactory: SdaiWorkerFactory by inject()
88+
val configuration = Configuration.Builder()
89+
.setWorkerFactory(workerFactory)
90+
.build()
91+
92+
WorkManager.initialize(this, configuration)
93+
} catch (e: Exception) {
94+
errorLog(e)
95+
}
96+
}
97+
}

0 commit comments

Comments
 (0)