File tree Expand file tree Collapse file tree 6 files changed +45
-24
lines changed Expand file tree Collapse file tree 6 files changed +45
-24
lines changed Original file line number Diff line number Diff line change 1010 <SplashScreen v-if =" app_state.show_splash_screen" ></SplashScreen >
1111 </transition >
1212 </div >
13- <ApplicationFrame v-else title =" DiffusionBee - Stable Diffusion App"
13+ <ApplicationFrame ref = " app_frame " v-else title =" DiffusionBee - Stable Diffusion App"
1414
1515 @menu_item_click_about =" show_about"
1616 @menu_item_click_help =" show_help"
2828
2929 <template v-slot :img2img >
3030
31- <Img2Img v-if =" is_mounted && stable_diffusion.is_backend_loaded" :app_state =" app_state" :stable_diffusion =" stable_diffusion" ></Img2Img >
31+ <Img2Img ref = " img2img " v-if =" is_mounted && stable_diffusion.is_backend_loaded" :app_state =" app_state" :stable_diffusion =" stable_diffusion" ></Img2Img >
3232 <div v-else class =" animatable_content_box " >
3333 <LoaderModal :loading_percentage =" stable_diffusion.loading_percentage" :loading_desc =" stable_diffusion.model_loading_msg" :loading_title =" stable_diffusion.model_loading_title ||'Loading model'" > </LoaderModal >
3434 </div >
@@ -239,9 +239,8 @@ export default
239239
240240 data () {
241241 let app_state = {
242-
243242 is_start_screen: true , // if the start screen is showing or not
244-
243+ app_object : this ,
245244 should_show_dialog_on_quit : false , // should ask "do you wanna quit" on closing
246245 show_dialog_on_quit_msg : " " , // the message to show while quiting
247246 show_splash_screen : true , // is showing the loading splash screen
Original file line number Diff line number Diff line change 2323
2424 <div v-for =" img in history_box.imgs" :key =" img" class =" history_box" >
2525
26- <ImageItem :hide_extra_save_button =" true" :path =" img" :style_obj =" {height:'100%'}" ></ImageItem >
26+ <ImageItem :app_state = " app_state " : hide_extra_save_button =" true" :path =" img" :style_obj =" {height:'100%'}" ></ImageItem >
2727
2828 </div >
2929 <div style =" clear : both ; display : table ; margin-bottom : 10px ;" >
Original file line number Diff line number Diff line change 1010 </template >
1111 <b-dropdown-item-button @click =" save_image(path)" >Save Image</b-dropdown-item-button >
1212 <b-dropdown-item-button >Upscale Image</b-dropdown-item-button >
13- <b-dropdown-item-button >Send to Img2Img</b-dropdown-item-button >
13+ <b-dropdown-item-button @click = " send_img2img " >Send to Img2Img</b-dropdown-item-button >
1414
1515
1616 </b-dropdown >
@@ -30,7 +30,8 @@ export default {
3030 name: ' ImageItem' ,
3131 props: {
3232 path : String ,
33- style_obj: String ,
33+ style_obj: Object ,
34+ app_state: Object ,
3435 hide_extra_save_button : Boolean ,
3536 },
3637 components: {},
@@ -56,6 +57,19 @@ export default {
5657 window .ipcRenderer .sendSync (' save_file' , org_path+ " ||" + out_path);
5758 },
5859
60+ send_img2img (){
61+ if (this .app_state ){
62+
63+ if (this .app_state .app_object .$refs .stable_diffusion .is_input_avail ){
64+ this .app_state .app_object .$refs .img2img .inp_img = this .path ;
65+ this .app_state .app_object .$refs .app_frame .selected_tab = ' img2img' ;
66+ }
67+
68+
69+ }
70+
71+ }
72+
5973 },
6074}
6175 </script >
Original file line number Diff line number Diff line change 9191 <div v-for =" img in generated_images" :key =" img" >
9292 <center >
9393
94- <ImageItem :path =" img" :style_obj =" { 'width': '75%' }" ></ImageItem >
94+ <ImageItem :app_state = " app_state " : path =" img" :style_obj =" { 'width': '75%' }" ></ImageItem >
9595
9696 </center >
9797 <br >
Original file line number Diff line number Diff line change 136136
137137 <div v-if =" generated_images.length == 1" >
138138 <center >
139-
140- <ImageItem :path =" generated_images[0]" :style_obj =" { 'width': 'calc(100vh - 380px )' , 'margin-top': '60px' }" ></ImageItem >
141-
139+ <ImageItem :app_state =" app_state" :path =" generated_images[0]" :style_obj =" { 'width': 'calc(100vh - 380px )' , 'margin-top': '60px' }" ></ImageItem >
142140 </center >
143141 </div >
144142
149147 <b-col v-for =" img in generated_images" :key =" img" style =" margin-top :80px " md =" 6" lg =" 4" xl =" 3" >
150148 <center >
151149
152- <ImageItem :path =" img" :style_obj =" {'max-width' :'85%'}" ></ImageItem >
150+ <ImageItem :app_state = " app_state " : path =" img" :style_obj =" {'max-width' :'85%'}" ></ImageItem >
153151 </center >
154152 </b-col >
155153
Original file line number Diff line number Diff line change 3030 </div >
3131 <div class =" tab_content_frame" >
3232 <div class =" tab_content" >
33- <KeepAlive >
34- <slot v-if =" selected_tab === 'txt2img' " name =" txt2img" ></slot >
35- </KeepAlive >
36-
37- <KeepAlive >
38- <slot v-if =" selected_tab === 'history' " name =" history" ></slot >
39- </KeepAlive >
33+
4034
41- <KeepAlive >
42- <slot v-if =" selected_tab === 'img2img' " name =" img2img" ></slot >
43- </KeepAlive >
44- <slot v-if =" selected_tab === 'logs' " name =" logs" ></slot >
35+ <div style =" display :none " :class =" { bl_display : selected_tab === 'txt2img' }" >
36+ <slot name =" txt2img" ></slot >
37+ </div >
4538
46- <slot v-if =" selected_tab === 'outpainting' " name =" outpainting" ></slot >
39+ <div v-if =" selected_tab === 'history' " style =" display :none " :class =" { bl_display : selected_tab === 'history' }" >
40+ <slot name =" history" ></slot >
41+ </div >
4742
43+ <div style =" display :none " :class =" { bl_display : selected_tab === 'img2img' }" >
44+ <slot name =" img2img" ></slot >
45+ </div >
46+
47+ <div v-if =" selected_tab === 'logs' " style =" display :none " :class =" { bl_display : selected_tab === 'logs' }" >
48+ <slot name =" logs" ></slot >
49+ </div >
50+
51+ <div v-if =" selected_tab === 'outpainting' " style =" display :none " :class =" { bl_display : selected_tab === 'outpainting' }" >
52+ <slot name =" outpainting" ></slot >
53+ </div >
4854
4955 </div >
5056
@@ -120,6 +126,10 @@ body {
120126 font-family : var (--main-font );
121127}
122128
129+ .bl_display {
130+ display :block !important ;
131+ }
132+
123133
124134.l_button {
125135 display : inline-block ;
You can’t perform that action at this time.
0 commit comments