@@ -5,19 +5,20 @@ import {
55 base64ToBlob ,
66 constructPayload ,
77 fetchOptions ,
8+ getImageInfo ,
89 setOptions ,
910 testForHistoryPlugin ,
10- getImageInfo
11- } from "./utils" ;
11+ } from "./Utilities" ;
1212
1313const manifest = {
14- name : "Stable Diffusion Webui " ,
14+ name : "stable-diffusion-webui " ,
1515 author : "Terry Jia" ,
1616 link : "https://github.com/jtydhr88" ,
1717 icon : `${ window . location . origin } /DummyImage.png` ,
1818 version : "0.0.0" ,
1919 license : "MIT" ,
20- description : "Stable Diffusion Webui Plugin" ,
20+ description :
21+ "This plugin uses [`stable-diffusion-webui`](https://github.com/AUTOMATIC1111/stable-diffusion-webui) as its back-end for inference" ,
2122} ;
2223
2324const webuiUpscalers = [
@@ -295,9 +296,12 @@ export const createPlugin = StableStudio.createPlugin<{
295296 const images = [ ] ;
296297
297298 for ( let i = 0 ; i < responseData . length ; i ++ ) {
298- const imageInfo = await getImageInfo ( webuiHostUrl , responseData [ i ] . content ) ;
299+ const imageInfo = await getImageInfo (
300+ webuiHostUrl ,
301+ responseData [ i ] . content
302+ ) ;
299303
300- const blob = await base64ToBlob ( responseData [ i ] . content , ' image/jpeg' ) ;
304+ const blob = await base64ToBlob ( responseData [ i ] . content , " image/jpeg" ) ;
301305
302306 const timestampInSeconds = responseData [ i ] . create_date ;
303307 const timestampInMilliseconds = timestampInSeconds * 1000 ;
@@ -308,20 +312,22 @@ export const createPlugin = StableStudio.createPlugin<{
308312 createdAt : createdAt ,
309313 blob : blob ,
310314 input : {
311- prompts : [ {
312- text : imageInfo [ "prompt" ] ,
313- weight : imageInfo [ "CFG scale" ] ,
314- } ] ,
315+ prompts : [
316+ {
317+ text : imageInfo [ "prompt" ] ,
318+ weight : imageInfo [ "CFG scale" ] ,
319+ } ,
320+ ] ,
315321 style : "" ,
316322 steps : Number ( imageInfo [ "Steps" ] ) ?? - 1 ,
317323 seed : Number ( imageInfo [ "Seed" ] ) ?? - 1 ,
318- model : imageInfo [ "Model" ] ?? "" ,
324+ model : imageInfo [ "Model" ] ?? "" ,
319325 width : responseData [ i ] . width ,
320- height : responseData [ i ] . height
321- }
322- }
326+ height : responseData [ i ] . height ,
327+ } ,
328+ } ;
323329
324- images . push ( stableDiffusionImage )
330+ images . push ( stableDiffusionImage ) ;
325331 }
326332
327333 return [
@@ -335,24 +341,26 @@ export const createPlugin = StableStudio.createPlugin<{
335341 settings : {
336342 baseUrl : {
337343 type : "string" ,
338- title : "WebUI Host URL" ,
339- description :
340- "The URL of the WebUI host. This is usually http://127.0.0.1:7861" ,
344+ title : "Host URL" ,
341345 placeholder : "http://127.0.0.1:7861" ,
342346 value : localStorage . getItem ( "webui-host-url" ) ?? "" ,
347+ description :
348+ "The URL of the `stable-diffusion-webui` host, usually http://127.0.0.1:7861" ,
343349 } ,
350+
344351 upscaler : {
345352 type : "string" ,
346353 title : "Upscaler 1" ,
347354 options : webuiUpscalers ,
348355 value : localStorage . getItem ( "upscaler1" ) ?? webuiUpscalers [ 0 ] . value ,
349356 description :
350- "Select the upscaler that is used when downloading images at more than 1x size. " ,
357+ "Select the upscaler used when downloading images at more than 1x size" ,
351358 } ,
359+
352360 historyImagesCount : {
353361 type : "number" ,
354362 title : "History image count" ,
355- description : "How many images do you get from webui locally ?" ,
363+ description : "How many images should be fetched from local history ?" ,
356364 min : 0 ,
357365 max : 50 ,
358366 step : 1 ,
0 commit comments