Skip to content

Commit f7692c4

Browse files
authored
Merge branch 'divamgupta:master' into add-clear-history-button
2 parents 19094cf + fd78899 commit f7692c4

File tree

8 files changed

+185
-39
lines changed

8 files changed

+185
-39
lines changed

backends/model_converter/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
build_test/
22
optimized_stable_diffusion/
33

4+
convert_sd_model_bin
5+
./convert_sd_model_bin
46

57
HF_weights/
68
outputs/

backends/model_converter/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyinstaller convert_model.py --onefile --noconfirm --clean

backends/stable_diffusion_tf/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ cp stable_diffusion_tf/clip_tokenizer/bpe_simple_vocab_16e6.txt.gz ./dist/diffus
33

44
cp -r ../realesrgan_ncnn/models ./dist/diffusionbee_backend/models
55
cp ../realesrgan_ncnn/realesrgan_ncnn_macos ./dist/diffusionbee_backend/realesrgan_ncnn_macos
6-
6+
cp ../model_converter/convert_sd_model_bin ./dist/diffusionbee_backend/convert_model
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: bee_env
2+
channels:
3+
- apple
4+
- conda-forge
5+
dependencies:
6+
- absl-py=0.10.0=pyhd8ed1ab_1
7+
- aiohttp=3.8.3=py39h02fc5c5_1
8+
- aiosignal=1.2.0=pyhd8ed1ab_0
9+
- altgraph=0.17.2=pyhd8ed1ab_1
10+
- astunparse=1.6.3=pyhd8ed1ab_0
11+
- async-timeout=4.0.2=pyhd8ed1ab_0
12+
- attrs=22.1.0=pyh71513ae_1
13+
- blinker=1.5=pyhd8ed1ab_0
14+
- brotlipy=0.7.0=py39h02fc5c5_1005
15+
- bzip2=1.0.8=h3422bc3_4
16+
- c-ares=1.18.1=h3422bc3_0
17+
- ca-certificates=2022.9.24=h4653dfc_0
18+
- cached-property=1.5.2=hd8ed1ab_1
19+
- cached_property=1.5.2=pyha770c72_1
20+
- cachetools=4.2.4=pyhd8ed1ab_0
21+
- certifi=2022.9.24=pyhd8ed1ab_0
22+
- cffi=1.15.1=py39h7e6b969_1
23+
- charset-normalizer=2.1.1=pyhd8ed1ab_0
24+
- click=8.1.3=unix_pyhd8ed1ab_2
25+
- cryptography=38.0.2=py39haa0b8cc_2
26+
- freetype=2.12.1=hd633e50_0
27+
- frozenlist=1.3.1=py39h02fc5c5_1
28+
- gast=0.4.0=pyh9f0ad1d_0
29+
- giflib=5.2.1=h27ca646_2
30+
- google-auth=1.35.0=pyh6c4a22f_0
31+
- google-auth-oauthlib=0.4.6=pyhd8ed1ab_0
32+
- google-pasta=0.2.0=pyh8c360ce_0
33+
- grpcio=1.49.1=py39h13431ec_0
34+
- h5py=3.1.0=nompi_py39h99babb8_100
35+
- hdf5=1.10.6=nompi_h0fc092c_1114
36+
- idna=3.4=pyhd8ed1ab_0
37+
- importlib-metadata=5.0.0=pyha770c72_1
38+
- jpeg=9e=he4db4b2_2
39+
- keras=2.6.0=pyhd8ed1ab_1
40+
- keras-preprocessing=1.1.2=pyhd8ed1ab_0
41+
- krb5=1.19.3=hf9b2bbe_0
42+
- lcms2=2.12=had6a04f_0
43+
- lerc=3.0=hbdafb3b_0
44+
- libabseil=20220623.0=cxx17_h28b99d4_4
45+
- libblas=3.9.0=16_osxarm64_openblas
46+
- libcblas=3.9.0=16_osxarm64_openblas
47+
- libclang=11.1.0=default_h0fdd720_1
48+
- libcurl=7.86.0=hd538317_0
49+
- libcxx=14.0.6=h2692d47_0
50+
- libdeflate=1.10=h3422bc3_0
51+
- libedit=3.1.20191231=hc8eb9b7_2
52+
- libev=4.33=h642e427_1
53+
- libffi=3.4.2=h3422bc3_5
54+
- libgfortran=5.0.0=11_3_0_hd922786_25
55+
- libgfortran5=11.3.0=hdaf2cc0_25
56+
- libgrpc=1.49.1=h503f348_0
57+
- liblapack=3.9.0=16_osxarm64_openblas
58+
- libllvm11=11.1.0=hfa12f05_5
59+
- libnghttp2=1.47.0=h232270b_1
60+
- libopenblas=0.3.21=openmp_hc731615_3
61+
- libpng=1.6.38=h76d750c_0
62+
- libprotobuf=3.21.9=hb5ab8b9_0
63+
- libsqlite=3.39.4=h76d750c_0
64+
- libssh2=1.10.0=hb80f160_3
65+
- libtiff=4.3.0=h2810ee2_4
66+
- libwebp=1.2.2=h0d20362_0
67+
- libwebp-base=1.2.2=h3422bc3_1
68+
- libxcb=1.13=h9b22ae9_1004
69+
- libzlib=1.2.13=h03a7124_4
70+
- llvm-openmp=14.0.4=hd125106_0
71+
- macholib=1.16.2=pyhd8ed1ab_0
72+
- markdown=3.4.1=pyhd8ed1ab_0
73+
- markupsafe=2.1.1=py39h02fc5c5_2
74+
- multidict=6.0.2=py39h02fc5c5_2
75+
- ncurses=6.3=h07bb92c_1
76+
- numpy=1.19.5=py39h54e5778_3
77+
- oauthlib=3.2.2=pyhd8ed1ab_0
78+
- openjpeg=2.5.0=hd370e0e_0
79+
- openssl=1.1.1q=h03a7124_1
80+
- opt_einsum=3.3.0=pyhd8ed1ab_1
81+
- pillow=9.0.1=py39hd72dd6b_2
82+
- pip=22.3=pyhd8ed1ab_0
83+
- protobuf=4.21.9=py39h23fbdae_0
84+
- pthread-stubs=0.4=h27ca646_1001
85+
- pyasn1=0.4.8=py_0
86+
- pyasn1-modules=0.2.7=py_0
87+
- pycparser=2.21=pyhd8ed1ab_0
88+
- pyinstaller-hooks-contrib=2022.11=pyhd8ed1ab_0
89+
- pyjwt=2.6.0=pyhd8ed1ab_0
90+
- pyopenssl=22.1.0=pyhd8ed1ab_0
91+
- pysocks=1.7.1=pyha2e5f31_6
92+
- python=3.9.10=hd16f9c5_2_cpython
93+
- python_abi=3.9=2_cp39
94+
- pyu2f=0.1.5=pyhd8ed1ab_0
95+
- re2=2022.06.01=h9a09cb3_0
96+
- readline=8.1.2=h46ed386_0
97+
- requests=2.28.1=pyhd8ed1ab_1
98+
- requests-oauthlib=1.3.1=pyhd8ed1ab_0
99+
- rsa=4.9=pyhd8ed1ab_0
100+
- scipy=1.9.1=py39h737da60_0
101+
- setuptools=65.5.0=pyhd8ed1ab_0
102+
- six=1.15.0=pyh9f0ad1d_0
103+
- sqlite=3.39.4=h2229b38_0
104+
- tensorboard=2.6.0=pyhd8ed1ab_1
105+
- tensorboard-data-server=0.6.0=py39haa0b8cc_3
106+
- tensorboard-plugin-wit=1.8.1=pyhd8ed1ab_0
107+
- tensorflow-deps=2.6.0=0
108+
- termcolor=1.1.0=pyhd8ed1ab_3
109+
- tk=8.6.12=he1e0b03_0
110+
- typing-extensions=3.7.4.3=0
111+
- typing_extensions=3.7.4.3=py_0
112+
- tzdata=2022e=h191b570_0
113+
- urllib3=1.26.11=pyhd8ed1ab_0
114+
- werkzeug=2.2.2=pyhd8ed1ab_0
115+
- wheel=0.35.1=pyh9f0ad1d_0
116+
- wrapt=1.12.1=py39h5161555_3
117+
- xorg-libxau=1.0.9=h27ca646_0
118+
- xorg-libxdmcp=1.1.3=h27ca646_0
119+
- xz=5.2.6=h57fd34a_0
120+
- yarl=1.8.1=py39h02fc5c5_0
121+
- zipp=3.10.0=pyhd8ed1ab_0
122+
- zlib=1.2.13=h03a7124_4
123+
- zstd=1.5.2=h8128057_4
124+
- pip:
125+
- clang==5.0
126+
- flatbuffers==1.12
127+
- ftfy==6.1.1
128+
- pyinstaller==5.2
129+
- regex==2022.9.13
130+
- tensorflow-estimator==2.10.0
131+
- tensorflow-macos==2.6.0
132+
- tensorflow-metal==0.1.2
133+
- tqdm==4.64.1
134+
- wcwidth==0.2.5

electron_app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "DiffusionBee",
3-
"version": "1.4.4",
4-
"build_number": "0015",
3+
"version": "1.5.0",
4+
"build_number": "0016",
55
"website": "https://diffusionbee.com",
66
"description": "Diffusion Bee - Stable Diffusion App.",
77
"is_dev": false,

electron_app/src/StableDiffusion.vue

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
import { send_to_py } from "./py_vue_bridge.js"
77
import {get_tokens} from './clip_tokeniser/clip_encoder.js'
8-
const nsfwjs = require('nsfwjs');
8+
99
1010
function remove_non_ascii(str) {
1111
@@ -49,39 +49,48 @@ export default {
4949
if(msg_code == "inwk"){
5050
this.is_input_avail = false;
5151
}
52+
53+
// removing the nsfw thing as it does not run in m1 build
54+
// if(msg_code == "nwim"){
55+
// let impath = msg.substring(5).trim()
56+
57+
// const img = new Image();
58+
// img.src = "file://" + impath;
59+
60+
// img.attached_cbs = this.attached_cbs;
61+
62+
// // check for nsfw content
63+
// img.onload = () => {
64+
// if (this.$parent.app_state.app_data.settings.nsfw_filter == true) {
65+
// if (img.attached_cbs) {
66+
// if (img.attached_cbs.on_img)
67+
// img.attached_cbs.on_img(impath);
68+
// }
69+
// }
70+
// else {
71+
// const nsfwjs = require('nsfwjs');
72+
// nsfwjs.load()
73+
// .then(model => model.classify(img))
74+
// .catch(() => {
75+
// console.log("cant run nsfw")
76+
// })
77+
// .then(predictions => {
78+
// if (predictions && (predictions[0].className == 'Hentai' || predictions[0].className == 'Porn')) {
79+
// impath = "nsfw_" + Math.random();
80+
// }
81+
// if (img.attached_cbs) {
82+
// if (img.attached_cbs.on_img)
83+
// img.attached_cbs.on_img(impath);
84+
// }
85+
// });
86+
// }
87+
// }
88+
// }
5289
if(msg_code == "nwim"){
5390
let impath = msg.substring(5).trim()
54-
55-
const img = new Image();
56-
img.src = "file://" + impath;
57-
58-
img.attached_cbs = this.attached_cbs;
59-
60-
// check for nsfw content
61-
img.onload = () => {
62-
if (this.$parent.app_state.app_data.settings.nsfw_filter == true) {
63-
if (img.attached_cbs) {
64-
if (img.attached_cbs.on_img)
65-
img.attached_cbs.on_img(impath);
66-
}
67-
}
68-
else {
69-
70-
nsfwjs.load()
71-
.then(model => model.classify(img))
72-
.catch(() => {
73-
console.log("cant run nsfw")
74-
})
75-
.then(predictions => {
76-
if (predictions && (predictions[0].className == 'Hentai' || predictions[0].className == 'Porn')) {
77-
impath = "nsfw_" + Math.random();
78-
}
79-
if (img.attached_cbs) {
80-
if (img.attached_cbs.on_img)
81-
img.attached_cbs.on_img(impath);
82-
}
83-
});
84-
}
91+
if(this.attached_cbs){
92+
if(this.attached_cbs.on_img)
93+
this.attached_cbs.on_img(impath);
8594
}
8695
}
8796

electron_app/src/background.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ protocol.registerSchemesAsPrivileged([
2626
])
2727

2828

29-
import {menu_template} from "./menu_template"
30-
Menu.setApplicationMenu(Menu.buildFromTemplate(menu_template))
29+
// import {menu_template} from "./menu_template"
30+
// Menu.setApplicationMenu(Menu.buildFromTemplate(menu_template))
3131

3232
start_bridge();
3333

electron_app/src/components/Settings.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div v-if="!is_custom_model_loading">
55
<h1>Settings</h1>
66
<br>
7-
<h2>General Settings</h2>
7+
<!-- <h2>General Settings</h2>
88
<br>
99
<div class="setting_box">
1010
<div class="settings_left">
@@ -19,7 +19,7 @@
1919
</label>
2020
</div>
2121
</div>
22-
<hr>
22+
<hr> -->
2323
<div class="l_button button_colored" style="float:right" @click="add_model" >Add New Model</div>
2424
<h2>Custom Models</h2>
2525

0 commit comments

Comments
 (0)