Skip to content

Commit 64952a3

Browse files
committed
some changes
1 parent 1ce1bf2 commit 64952a3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

electron_app/src/StableDiffusion.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default {
3939
attached_cbs : undefined,
4040
model_version : "",
4141
nb_its: 0,
42-
times: [],
42+
iter_times: [],
4343
generation_loop: undefined
4444
};
4545
},
@@ -144,8 +144,8 @@ export default {
144144
if(this.attached_cbs.on_progress){
145145
if(p >= 0 ){
146146
this.generation_state_msg = iter_time/1000 + " s/it";
147-
this.times.push(iter_time);
148-
let median = this.times.sort((a, b) => a - b)[Math.floor(this.times.length / 2)];
147+
this.iter_times.push(iter_time);
148+
let median = this.iter_times.sort((a, b) => a - b)[Math.floor(this.iter_times.length / 2)];
149149
let time_remaining = moment.duration(median*((100-p)*this.nb_its/100));
150150
151151
this.remaining_times = compute_time_remaining(time_remaining);
@@ -168,6 +168,7 @@ export default {
168168
169169
interupt(){
170170
send_to_py("t2im __stop__")
171+
clearInterval(this.generation_loop);
171172
},
172173
173174
text_to_img(prompt_params, callbacks, generated_by){
@@ -199,7 +200,7 @@ export default {
199200
this.attached_cbs = callbacks;
200201
this.generation_state_msg = ""
201202
this.remaining_times = ""
202-
this.times = []
203+
this.iter_times = []
203204
this.nb_its = prompt_params.ddim_steps||25
204205
send_to_py("t2im " + JSON.stringify(prompt_params))
205206
}

0 commit comments

Comments
 (0)