@@ -133,10 +133,13 @@ export default {
133
133
const waitingOnResponse = ref ( false )
134
134
const storage = new ThreadStorage ( `img2txt` , {
135
135
model : 'jib-mix-realistic' ,
136
+ positivePrompt : "" ,
136
137
negativePrompt : '(nsfw),(explicit),(gore),(violence),(blood)' ,
137
138
width : 1024 ,
138
139
height : 1024 ,
139
140
batchSize : 1 ,
141
+ seed : '' ,
142
+ tag : '' ,
140
143
} )
141
144
const error = ref ( )
142
145
@@ -165,6 +168,7 @@ export default {
165
168
storage . saveHistory ( history . value )
166
169
}
167
170
function saveThread ( ) {
171
+ console . log ( 'saveThread' , thread . value )
168
172
if ( thread . value ) {
169
173
storage . saveThread ( thread . value )
170
174
}
@@ -279,15 +283,14 @@ export default {
279
283
const id = parseInt ( routes . id )
280
284
thread . value = storage . getThread ( storage . getThreadId ( id ) )
281
285
threadRef . value = history . value . find ( x => x . id === parseInt ( routes . id ) )
282
- // console.log('thread', id, thread.value)
283
- // console.log('threadRef', threadRef .value)
286
+ Object . keys ( storage . defaults ) . forEach ( field =>
287
+ request . value [ field ] = thread . value [ field ] ?? storage . defaults [ field ] )
284
288
} else {
285
289
thread . value = null
286
290
}
287
291
}
288
292
289
293
function updated ( ) {
290
- // console.debug('updated', routes.admin, routes.id)
291
294
onRouteChange ( )
292
295
}
293
296
@@ -313,6 +316,20 @@ export default {
313
316
}
314
317
315
318
watch ( ( ) => routes . id , updated )
319
+ watch ( ( ) => [
320
+ request . value . model ,
321
+ request . value . positivePrompt ,
322
+ request . value . negativePrompt ,
323
+ request . value . width ,
324
+ request . value . height ,
325
+ request . value . batchSize ,
326
+ request . value . seed ,
327
+ request . value . tag ,
328
+ ] , ( ) => {
329
+ Object . keys ( storage . defaults ) . forEach ( field =>
330
+ thread . value [ field ] = request . value [ field ] ?? storage . defaults [ field ] )
331
+ saveThread ( )
332
+ } )
316
333
317
334
onMounted ( async ( ) => {
318
335
const api = await client . api ( new ActiveMediaModels ( ) )
0 commit comments