Skip to content

Commit 384001c

Browse files
committed
1st release build
1 parent d061e67 commit 384001c

14 files changed

Lines changed: 491 additions & 227 deletions

File tree

electron_app/afterSignHook.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = async function (params) {
1010

1111
console.log('afterSign hook triggered', params);
1212

13-
let appId = 'com.linerai.stablediffusionui'
13+
let appId = 'com.linerai.diffusionbee'
1414

1515
let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
1616
if (!fs.existsSync(appPath)) {

electron_app/package-lock.json

Lines changed: 134 additions & 111 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron_app/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "StableDiffusionGUI",
2+
"name": "DiffusionBee",
33
"version": "0.1.0",
44
"build_number": "0001",
5-
"website": "https://divam.io",
6-
"description": "StableDiffusionGUI",
7-
"is_dev": true,
5+
"website": "https://github.com/divamgupta/diffusionbee-stable-diffusion-ui",
6+
"description": "Diffusion Bee - GUI for stable diffusion.",
7+
"is_dev": false,
88
"private": true,
99
"scripts": {
1010
"serve": "vue-cli-service serve",
@@ -47,7 +47,7 @@
4747
"@vue/cli-service": "~4.5.0",
4848
"babel-eslint": "^10.1.0",
4949
"electron": "^13.0.0",
50-
"electron-builder": "^23.0.2",
50+
"electron-builder": "^23.3.3",
5151
"electron-devtools-installer": "^3.1.0",
5252
"eslint": "^6.7.2",
5353
"eslint-plugin-vue": "^6.2.2",

electron_app/src/App.vue

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@
88
<SplashScreen v-if="app_state.show_splash_screen"></SplashScreen>
99
</transition>
1010
</div>
11-
<ApplicationFrame v-else title="DiffusionBee - Stable Diffusion GUI">
11+
<ApplicationFrame v-else title="DiffusionBee - Stable Diffusion GUI"
12+
13+
@menu_item_click_about="show_about"
14+
@menu_item_click_help="show_help"
15+
@menu_item_click_close="close_window"
16+
17+
>
18+
19+
1220
<template v-slot:txt2img>
1321
<ImgGenerate :app_state="app_state"></ImgGenerate>
1422

@@ -52,7 +60,7 @@ import SplashScreen from './components_bare/SplashScreen.vue'
5260
import ApplicationFrame from './components_bare/ApplicationFrame.vue'
5361
import ImgGenerate from './components/ImgGenerate.vue'
5462
55-
63+
native_alert;
5664
5765
export default
5866
@@ -78,7 +86,7 @@ export default
7886
setTimeout( function(){
7987
8088
that.app_state.is_start_screen = false;
81-
} , 1000)
89+
} , 4000)
8290
8391
},
8492
@@ -126,14 +134,7 @@ export default
126134
127135
},
128136
129-
show_about(){
130-
window.ipcRenderer.sendSync('show_about', '');
131-
},
132-
133-
show_help(){
134-
window.ipcRenderer.sendSync('open_url', "__domain__/documentation");
135-
} ,
136-
137+
137138
change_startscreen_tab(tab_name){
138139
let that = this;
139140
setTimeout( function(){
@@ -142,24 +143,12 @@ export default
142143
143144
},
144145
145-
export_dataset(){
146-
147-
if(Object.keys(this.app_state.dataset).length == 0)
148-
{
149-
native_alert("Your dataset is empty. Nothing to export.")
150-
return;
151-
}
152-
153-
let output_path = window.ipcRenderer.sendSync('save_dialog', '');
154-
if(output_path)
155-
send_to_py("exds " + output_path );
156-
},
157-
146+
158147
check_for_updates(){
159148
160149
let xmlHttp = new XMLHttpRequest();
161150
let user_id = window.ipcRenderer.sendSync('get_instance_id' , '');
162-
let updates_url = "https://frq9ygdtq6.execute-api.us-east-1.amazonaws.com/liner_check_updates?user_id="+user_id;
151+
let updates_url = "https://aeyfmzu2ac.execute-api.us-east-1.amazonaws.com/check_diffusionbee_updates?user_id="+user_id;
163152
xmlHttp.onreadystatechange = function() {
164153
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
165154
{
@@ -201,9 +190,21 @@ export default
201190
this.should_show_dialog_on_quit = false;
202191
window.ipcRenderer.sendSync('dont_show_dialog_on_quit', '');
203192
}
193+
} ,
194+
195+
show_about(){
196+
window.ipcRenderer.sendSync('show_about', '');
197+
},
198+
show_help(){
199+
window.ipcRenderer.sendSync('open_url', "https://github.com/divamgupta/diffusionbee-stable-diffusion-ui");
200+
} ,
201+
202+
close_window(){
203+
window.ipcRenderer.sendSync('close_window', '');
204204
}
205205
206206
207+
207208
},
208209
209210
267 KB
Loading

electron_app/src/assets/logo_splash.svg

Lines changed: 82 additions & 66 deletions
Loading

electron_app/src/bridge.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ function start_bridge() {
2727
python.stdout.on('data', function(data) {
2828
console.log("Python response: ", data.toString('utf8'));
2929

30-
win.webContents.send('to_renderer', 'adlg ' + data.toString('utf8'));
30+
31+
if(! data.toString().includes("___U_P_D_A_T_E___"))
32+
win.webContents.send('to_renderer', 'adlg ' + data.toString('utf8'));
3133

3234

3335
if (win) {

electron_app/src/components/ImgGenerate.vue

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@
8181
<div v-if="app_state.generated_image" style="margin-top:80px" >
8282
<center>
8383
<img v-if="app_state.generated_image" :src="'file://' + app_state.generated_image">
84+
<br>
85+
<div @click="save_image" class="l_button">Save Image</div>
8486
</center>
85-
87+
<br><br><br>
8688
</div>
8789

8890

@@ -117,7 +119,7 @@
117119
</div>
118120

119121
<div class="bottom_float">
120-
<p>Stable diffusion requires a lot of RAM. Close other applications for best speed.</p>
122+
<p>Stable diffusion requires a lot of RAM. 16GB recommended. Close other applications for best speed.</p>
121123
</div>
122124

123125
</div>
@@ -142,8 +144,8 @@ export default {
142144
},
143145
data() {
144146
return {
145-
img_w : 256,
146-
img_h : 256 ,
147+
img_w : 512,
148+
img_h : 512 ,
147149
dif_steps : 25,
148150
guidence_scale : 7.5 ,
149151
is_adv_options : false ,
@@ -163,6 +165,19 @@ export default {
163165
164166
}
165167
send_to_py("t2im " + JSON.stringify(params))
168+
} ,
169+
170+
save_image(){
171+
if(!this.app_state.generated_image)
172+
return;
173+
let out_path = window.ipcRenderer.sendSync('save_dialog', '');
174+
if(!out_path)
175+
return
176+
177+
let org_path = this.app_state.generated_image.replaceAll("file://" , "")
178+
179+
window.ipcRenderer.sendSync('save_file', org_path+"||" +out_path);
180+
166181
}
167182
},
168183
}

electron_app/src/components_bare/SplashScreen.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="splash_screen">
33
<Transition name="fade">
4-
<img v-if=show width="60%" src="@/assets/logo_splash.svg">
4+
<img v-if=show width="60%" src="@/assets/logo_splash.png">
55
</Transition>
66
</div>
77
</template>

electron_app/src/native_functions.js

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,24 @@ function bind_window_native_functions(w) {
1414
let is_windows = process.platform.startsWith('win');
1515

1616

17+
18+
console.log(require('os').freemem()/(1000000000) + " Is the free memory")
19+
console.log(require('os').totalmem()/(1000000000) + " Is the total memory")
20+
21+
1722
ipcMain.on('save_dialog', (event, arg) => {
1823

19-
let save_path = dialog.showSaveDialogSync()
24+
let save_path = dialog.showSaveDialogSync({
25+
filters: [{
26+
name: 'Image',
27+
extensions: ['png']
28+
}]
29+
})
2030

2131
event.returnValue = save_path;
2232
} )
2333

34+
console.log(require('os').release() + " ohoho")
2435

2536

2637

@@ -108,6 +119,15 @@ ipcMain.on('open_url', (event, url) => {
108119

109120

110121

122+
ipcMain.on('save_file', (event, arg) => {
123+
let p1 = arg.split("||")[0];
124+
let p2 = arg.split("||")[1];
125+
require('fs').copyFileSync(p1, p2);
126+
event.returnValue = '';
127+
})
128+
129+
130+
111131

112132

113133
ipcMain.on('show_dialog_on_quit', (event, msg) => {
@@ -260,6 +280,22 @@ ipcMain.on('native_confirm', (event, arg) => {
260280

261281

262282

283+
ipcMain.on('close_window', (event, arg) => {
284+
285+
if (win) {
286+
287+
win.close()
288+
event.returnValue = true ;
289+
}
290+
else{
291+
event.returnValue = false ;
292+
}
293+
294+
})
295+
296+
297+
298+
263299
ipcMain.on('native_alert', (event, arg) => {
264300

265301
if (win) {

0 commit comments

Comments
 (0)