Skip to content

Commit 2c4da54

Browse files
author
committed
update
1 parent 5cb54e9 commit 2c4da54

File tree

18 files changed

+216
-295
lines changed

18 files changed

+216
-295
lines changed

examples/stable_diffusion_app/android/app/src/main/AndroidManifest.xml

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
<meta-data
3131
android:name="flutterEmbedding"
3232
android:value="2" />
33+
34+
<meta-data
35+
android:name="io.flutter.embedding.android.EnableImpeller"
36+
android:value="false" />
3337
</application>
3438
<!-- Required to query activities that can process text, see:
3539
https://developer.android.com/training/package-visibility and
5.17 KB
Loading

examples/stable_diffusion_app/guide-dart-general_system_device-library.md

+3
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ code android/app/src/main/AndroidManifest.xml
281281
android:name="flutterEmbedding"
282282
android:value="2" />
283283

284+
<meta-data
285+
android:name="io.flutter.embedding.android.EnableImpeller"
286+
android:value="false" />
284287
<!-- Adapt to the foreground service type(s) desired, these are just examples -->
285288
<service
286289
android:name="de.julianassmann.flutter_background.IsolateHolderService"

examples/stable_diffusion_app/lib/core/core.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ class StableDiffusionAppClientFlutter {
155155
if (fileCopy.existsSync()) {
156156
fileCopy.deleteSync(recursive: true);
157157
}
158-
await file.copy(fileCopy.path);
159-
await file.delete(recursive: true);
158+
file.copySync(fileCopy.path);
159+
file.deleteSync(recursive: true);
160160
return fileCopy;
161161
}
162162
return file;
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,39 @@
1-
/* <!-- START LICENSE -->
2-
3-
4-
This Software / Program / Source Code Created By Developer From Company GLOBAL CORPORATION
5-
Social Media:
6-
7-
- Youtube: https://youtube.com/@Global_Corporation
8-
- Github: https://github.com/globalcorporation
9-
- TELEGRAM: https://t.me/GLOBAL_CORP_ORG_BOT
10-
11-
All code script in here created 100% original without copy / steal from other code if we copy we add description source at from top code
12-
13-
If you wan't edit you must add credit me (don't change)
14-
15-
If this Software / Program / Source Code has you
16-
17-
Jika Program ini milik anda dari hasil beli jasa developer di (Global Corporation / apapun itu dari turunan itu jika ada kesalahan / bug / ingin update segera lapor ke sub)
18-
19-
Misal anda beli Beli source code di Slebew CORPORATION anda lapor dahulu di slebew jangan lapor di GLOBAL CORPORATION!
20-
21-
Jika ada kendala program ini (Pastikan sebelum deal project tidak ada negosiasi harga)
22-
Karena jika ada negosiasi harga kemungkinan
23-
24-
1. Software Ada yang di kurangin
25-
2. Informasi tidak lengkap
26-
3. Bantuan Tidak Bisa remote / full time (Ada jeda)
27-
28-
Sebelum program ini sampai ke pembeli developer kami sudah melakukan testing
29-
30-
jadi sebelum nego kami sudah melakukan berbagai konsekuensi jika nego tidak sesuai ?
31-
Bukan maksud kami menipu itu karena harga yang sudah di kalkulasi + bantuan tiba tiba di potong akhirnya bantuan / software kadang tidak lengkap
32-
33-
34-
<!-- END LICENSE --> */
351
// ignore_for_file: non_constant_identifier_names
362
import 'dart:convert';
373

384
/// AutoGenerateBy Packagex
395
class PackagexProjectStableDiffusionApp {
40-
/// AutoGenerateBy Packagex
41-
static bool isSame({required String data}) {
6+
/// AutoGenerateBy Packagex
7+
static bool isSame({
8+
required String data
9+
}) {
4210
return [default_data_to_string, json.encode(default_data)].contains(data);
4311
}
44-
45-
/// AutoGenerateBy Packagex
46-
static String get default_data_to_string {
47-
return (JsonEncoder.withIndent(" " * 2).convert(default_data));
12+
/// AutoGenerateBy Packagex
13+
static String get default_data_to_string {
14+
return (JsonEncoder.withIndent(" " * 2).convert(default_data));
15+
}
16+
/// AutoGenerateBy Packagex
17+
static Map get default_data {
18+
return {
19+
"name": "stable_diffusion_app",
20+
"description": "A new Flutter project.",
21+
"publish_to": "none",
22+
"version": "1.0.0+1",
23+
"repository": "https://github.com/General-Developer/whisper_library",
24+
"homepage": "https://www.youtube.com/@general_dev",
25+
"issue_tracker": "https://t.me/DEVELOPER_GLOBAL_PUBLIC",
26+
"documentation": "https://www.youtube.com/@general_dev",
27+
"funding": [
28+
"https://github.com/sponsors/General-Developer",
29+
"https://github.com/sponsors/azkadev",
30+
"https://github.com/sponsors/generalfoss",
31+
"https://github.com/sponsors/general-developer"
32+
],
33+
"project": {
34+
"type": ""
4835
}
36+
};
37+
}
4938

50-
/// AutoGenerateBy Packagex
51-
static Map get default_data {
52-
return {
53-
"name": "stable_diffusion_app",
54-
"description": "A new Flutter project.",
55-
"publish_to": "none",
56-
"version": "1.0.0+1",
57-
"repository": "https://github.com/General-Developer/whisper_library",
58-
"homepage": "https://www.youtube.com/@general_dev",
59-
"issue_tracker": "https://t.me/DEVELOPER_GLOBAL_PUBLIC",
60-
"documentation": "https://www.youtube.com/@general_dev",
61-
"funding": ["https://github.com/sponsors/General-Developer", "https://github.com/sponsors/azkadev", "https://github.com/sponsors/generalfoss", "https://github.com/sponsors/general-developer"],
62-
"project": {"type": ""}
63-
};
64-
}
65-
}
39+
}

examples/stable_diffusion_app/lib/page/stable_diffusion/stable_diffusion.dart

+35-15
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Bukan maksud kami menipu itu karena harga yang sudah di kalkulasi + bantuan tiba
3838
import 'dart:io';
3939

4040
import 'package:general_framework/flutter/fork/skeletonizer/lib/src/widgets/skeletonizer.dart';
41+
import 'package:general_framework/flutter/loading/loading.dart';
42+
import 'package:general_framework/flutter/loading/loading_core.dart';
4143
import 'package:stable_diffusion_app/core/core.dart';
4244
import 'package:stable_diffusion_app/scheme/scheme/application_stable_diffusion_library_database.dart';
4345

@@ -195,8 +197,9 @@ class _SpeechToTextPageState extends State<StableDiffusionPage> with GeneralLibF
195197
void updateModel({
196198
required File stableDiffusionModel,
197199
}) {
200+
final fileStat = stableDiffusionModel.statSync();
198201
setState(() {
199-
modelSize = stableDiffusionModel.statSync().size;
202+
modelSize = fileStat.size;
200203
modelName = path.basename(stableDiffusionModel.path);
201204
loadStableDiffusionModelFromFileStableDiffusionLibrary.model_file_path = stableDiffusionModel.path;
202205
isLoadedModel = false;
@@ -277,27 +280,44 @@ class _SpeechToTextPageState extends State<StableDiffusionPage> with GeneralLibF
277280
onPressed: () {
278281
handleFunction(
279282
onFunction: (context, statefulWidget) async {
280-
final file = await StableDiffusionAppClientFlutter.pickFile(
281-
dialogTitle: "Stable Diffusion Model",
282-
);
283-
if (file == null) {
283+
final LoadingGeneralFrameworkController loadingGeneralFrameworkController = LoadingGeneralFrameworkController(loadingText: "Load Model Files");
284+
LoadingGeneralFramework.show(context: context, loadingGeneralFrameworkController: loadingGeneralFrameworkController);
285+
try {
286+
final file = await StableDiffusionAppClientFlutter.pickFile(
287+
dialogTitle: "Stable Diffusion Model",
288+
);
289+
if (file == null) {
290+
context.showAlertGeneralFramework(
291+
alertGeneralFrameworkOptions: AlertGeneralFrameworkOptions(
292+
title: "Failed Load Model Stable Diffusion",
293+
builder: (context, alertGeneralFrameworkOptions) {
294+
return "Coba lagi";
295+
},
296+
),
297+
);
298+
return;
299+
}
300+
301+
/// save to application settings
302+
{
303+
final ApplicationStableDiffusionLibraryDatabase applicationStableDiffusionLibraryDatabase = getApplicationStableDiffusionLibraryDatabase();
304+
applicationStableDiffusionLibraryDatabase.stable_diffusion_model_path = file.path;
305+
saveApplicationStableDiffusionLibraryDatabase();
306+
updateModel(
307+
stableDiffusionModel: File(applicationStableDiffusionLibraryDatabase.stable_diffusion_model_path ?? ""),
308+
);
309+
}
310+
context.navigator().pop();
311+
} catch (e, stack) {
312+
context.navigator().pop();
284313
context.showAlertGeneralFramework(
285314
alertGeneralFrameworkOptions: AlertGeneralFrameworkOptions(
286315
title: "Failed Load Model Stable Diffusion",
287316
builder: (context, alertGeneralFrameworkOptions) {
288-
return "Coba lagi";
317+
return "Error: ${e} - ${stack}";
289318
},
290319
),
291320
);
292-
return;
293-
}
294-
295-
/// save to application settings
296-
{
297-
final ApplicationStableDiffusionLibraryDatabase applicationStableDiffusionLibraryDatabase = getApplicationStableDiffusionLibraryDatabase();
298-
applicationStableDiffusionLibraryDatabase.stable_diffusion_model_path = file.path;
299-
saveApplicationStableDiffusionLibraryDatabase();
300-
updateModel(stableDiffusionModel: File(applicationStableDiffusionLibraryDatabase.stable_diffusion_model_path ?? ""));
301321
}
302322
},
303323
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
opt/stable-diffusion-app
2+
usr/bin/stable_diffusion_app
3+
usr/share/stable_diffusion_app
4+
usr/local/bin/stable_diffusion_app
5+
usr/bin/stable-diffusion-app
6+
usr/share/stable-diffusion-app
7+
usr/local/bin/stable-diffusion-app
8+
*.exe
9+
*.deb
10+
*.sqlite-*
11+
*.sqlite
12+
docs/canvaskit
13+
*/canvaskit
14+
.dart_tool/
15+
build/
16+
ephemeral/
17+
/build/
18+
generate_general_private_tools_*
19+
node_modules/
20+
flutter/ephemeral
21+
android/.gradle
22+
android/flutter/ephemeral
23+
linux/flutter/ephemeral
24+
macos/Flutter/ephemeral
25+
windows/ephemeral
26+
tmp/
27+
temp/
28+
packagex-build-debug
29+
packagex-compile-debug
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Maintainer: "[email protected]>"
2+
Package: stable-diffusion-app
3+
Version: 1.0.0+1
4+
Section: x11
5+
Priority: optional
6+
Architecture: all
7+
Essential: no
8+
Installed-Size: 0
9+
Description: "-"
10+
Homepage: "-"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
ln --force -s /opt/stable-diffusion-app/stable_diffusion_app /usr/bin/stable-diffusion-app-app
3+
chmod +x /usr/bin/stable-diffusion-app-app
4+
5+
exit 0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env sh
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*
2+
!.gitignore
3+
*.exe
4+
*.deb
5+
*.sqlite-*
6+
*.sqlite
7+
docs/canvaskit
8+
*/canvaskit
9+
.dart_tool/
10+
build/
11+
ephemeral/
12+
/build/
13+
generate_general_private_tools_*
14+
node_modules/
15+
flutter/ephemeral
16+
android/.gradle
17+
android/flutter/ephemeral
18+
linux/flutter/ephemeral
19+
macos/Flutter/ephemeral
20+
windows/ephemeral
21+
tmp/
22+
temp/
23+
packagex-build-debug
24+
packagex-compile-debug
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*
2+
!.gitignore
3+
*.exe
4+
*.deb
5+
*.sqlite-*
6+
*.sqlite
7+
docs/canvaskit
8+
*/canvaskit
9+
.dart_tool/
10+
build/
11+
ephemeral/
12+
/build/
13+
generate_general_private_tools_*
14+
node_modules/
15+
flutter/ephemeral
16+
android/.gradle
17+
android/flutter/ephemeral
18+
linux/flutter/ephemeral
19+
macos/Flutter/ephemeral
20+
windows/ephemeral
21+
tmp/
22+
temp/
23+
packagex-build-debug
24+
packagex-compile-debug
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Desktop Entry]
2+
Name=Stable Diffusion App
3+
GenericName=Stable Diffusion App
4+
Version=1.0.0+1
5+
Exec=/opt/stable-diffusion-app/stable_diffusion_app
6+
Icon=/opt/stable-diffusion-app/data/flutter_assets/assets/icon.png
7+
Terminal=false
8+
Type=Application
9+
Categories=Music;Media;
10+
Keywords=Hello;World;Test;Application;
11+
StartupNotify=true

examples/stable_diffusion_app/pubspec.lock

-16
Original file line numberDiff line numberDiff line change
@@ -1163,22 +1163,6 @@ packages:
11631163
url: "https://pub.dev"
11641164
source: hosted
11651165
version: "3.3.1"
1166-
system_information:
1167-
dependency: transitive
1168-
description:
1169-
name: system_information
1170-
sha256: "36ef787a388abb2110ce2bc68ed4e892002ddcc639824c6039ca01618454dd03"
1171-
url: "https://pub.dev"
1172-
source: hosted
1173-
version: "0.0.13"
1174-
system_information_flutter:
1175-
dependency: transitive
1176-
description:
1177-
name: system_information_flutter
1178-
sha256: "2f2b54c49445d78f5f6649d51b420b1bdd2b81fb0c3c498854173e7d63c0446c"
1179-
url: "https://pub.dev"
1180-
source: hosted
1181-
version: "0.0.13"
11821166
term_glyph:
11831167
dependency: transitive
11841168
description:

examples/stable_diffusion_app/pubspec.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ dev_dependencies:
3333
msix: '^3.16.8'
3434
flutter:
3535
uses-material-design: true
36+
assets:
37+
- 'assets/./'
3638
project:
3739
type: ''
3840
dependency_overrides:

package/stable_diffusion_library/pubspec.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,18 @@ packages:
194194
dependency: "direct main"
195195
description:
196196
name: general_lib
197-
sha256: eca0c5127a72b7e331f3fbcd47bf6dd4c6a6a2f6fbeebe677c2258b8fa145f2d
197+
sha256: d576cf998e4827a92894ef78c02b7f03ab61342d69e91bab0cfc9fd4836a636c
198198
url: "https://pub.dev"
199199
source: hosted
200-
version: "0.0.70"
200+
version: "0.0.71"
201201
general_schema:
202202
dependency: "direct main"
203203
description:
204204
name: general_schema
205-
sha256: a8dc51bb085e497c7bcbe6a09af3e58c83a82e1499c1d05fa3b0c3ec05279cb7
205+
sha256: "4a288f45f8616687772e14f81372da5176a052e47228e30a67e91694a58b10e1"
206206
url: "https://pub.dev"
207207
source: hosted
208-
version: "0.0.1"
208+
version: "0.0.2"
209209
glob:
210210
dependency: transitive
211211
description:

0 commit comments

Comments
 (0)