diff --git a/.gitignore b/.gitignore index cd43fa4..dfdc1ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /cache/* -/scripts/__pycache__/* /scripts/__pycache__ +/scripts/__pycache__/* +/scripts/__pycache__/ /yours/* !/yours/.gitkeep @@ -8,7 +9,7 @@ *.swp *.pyc *.idea* -*__pycache__* + diff --git a/README.md b/README.md index 98def26..5f28bd7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ -# sd-webui-oldsix_prompt v1.3 +# sd-webui-oldsix_prompt v1.31 ### 新词库由群里小伙伴 @麻瓜 @万碎爷 @元一斤 整理 +### 100%完全自制插件,不是魔改别人,最近有个别up未均本人允许,在多个平台打着nsfw词库的旗号拿本插件吸粉入群,别人安装插件出问题又无法提供解决方案 ### +### 本插件前前后后花了大半个月,阅读大量英文文档,研究了大量代码,最后才开发完成,觉得好用的可以给我点颗星。 +### #### 英文不好不用怕!彻底解决prompt对于国人不友好的痛点,整理了多个分类上千个提示词,无需英文快速输入提示词 -#### 词库会持续更新,觉得不错的点个start -#### AI交流Q群875376246 各种疑难解答 帮你踩坑 +#### 词库会持续更新 +* AI交流Q群875376246 各种疑难解答 帮你踩坑 +* 已分好类别的词库,不会做太大改动,尽量不破坏大家的使用习惯 + --- ### 安装方法 * 方法1、复制地址到你的webui中 从网站安装后应用并重启 @@ -15,8 +20,10 @@ --- ### 使用方法 * 左键输入正向提示框、 右键输入负向提示框 - * 支持随机抽卡 + * 支持随机抽卡 【灵感模式、分类随机模式】 + * 支持动态提示词 本插件专属语法示例:#[red,blue,yellow] --- ##### 展示 ![Image text](imgs/1.png) + ![Image text](imgs/2.png) diff --git a/imgs/2.png b/imgs/2.png new file mode 100644 index 0000000..9cfe385 Binary files /dev/null and b/imgs/2.png differ diff --git a/javascript/old_six_prompt.js b/javascript/old_six_prompt.js index 2f8ca54..69999c2 100644 --- a/javascript/old_six_prompt.js +++ b/javascript/old_six_prompt.js @@ -32,10 +32,9 @@ let dicClass={ 1:{} } -const loadTime=3000 +const loadTime=1500 - function getEle(key) { return gradioApp().querySelector(key) @@ -134,16 +133,19 @@ function toggleNavCss(dom){ async function getJsonStr() { - await new Promise(resolve => setTimeout(resolve, loadTime)); - + await new Promise(resolve => setTimeout(resolve, loadTime)); let val1 = document.querySelector("#oldsix-area1 textarea").value let val2 = document.querySelector("#oldsix-area2 textarea").value return val1||val2 } function clearTextarea(){ - document.querySelector("#oldsix-area1 textarea").value='area1' - document.querySelector("#oldsix-area2 textarea").value='area2' + let elarea1= document.querySelector("#oldsix-area1 textarea") + let elarea2= document.querySelector("#oldsix-area2 textarea") + elarea1.value='' + elarea2.value='' + updateInput(elarea1) + updateInput(elarea2) } function createBtnTitle(name,val,parent,pageindex){ @@ -158,8 +160,13 @@ function createBtnTitle(name,val,parent,pageindex){ for (const key in val) { if (typeof val[key] != 'object' ) btn.addEventListener('click', function () { - addDicClasses(name,val,pageindex) - }) + addDicClasses(name, val, pageindex) + }); + btn.addEventListener('contextmenu', function (e) { + e.preventDefault(); + addDynamicToTextArea(btn,pageindex) + + }) return div } @@ -167,9 +174,28 @@ function createBtnTitle(name,val,parent,pageindex){ } +function addDynamicToTextArea(btnele,pageindex){ + let btns= btnele.parentNode.querySelectorAll('.oldsix-btn') + if(btns.length){ + let text='#[' + for (let index = 0; index < btns.length; index++) { + text+=btns[index].dataset.sixoldtit + if(index { Elements.btnRandoms.forEach((item,index) => { item.addEventListener('click', () => { ranDomPropt(index) - }) + }) }) Elements.btnReload.forEach((item,index) => { @@ -420,6 +453,7 @@ onUiLoaded(async => { elementprompt.value='' elementprompt.focus(); let str=Elements.RdtxtAreasEn[index].value + str=Elements.txtStart[index].value+str+Elements.txtEnd[index].value document.execCommand('insertText', false,str); }) }) diff --git a/json/01起手式.json b/json/01起手式.json index 9c7de92..3891ddd 100644 --- a/json/01起手式.json +++ b/json/01起手式.json @@ -1 +1 @@ -{"正面起手": {"简单起手": "best quality,masterpiece", "真实风格起手": "best quality,masterpiece,realistic", "提高质量": "HDR,UHD,8K", "最佳质量": "best quality", "写实": "realistic", "杰作": "masterpiece", "更多细节": "Highly detailed", "简单背景": "simple background", "模糊背景": "blurry background", "演播室灯光": "Studio lighting", "超精细绘画": "ultra-fine painting", "聚焦清晰": "sharp focus", "物理渲染": "physically-based rendering", "极详细刻画": "extreme detail description", "改善细节": "Professional", "添加鲜艳色彩": "Vivid Colors", "虚化模糊景": "Bokeh", "相机设置": "(EOS R8,50mm,F1.2,8K,RAW photo", "老照片": "High resolution scan", "素描": "Sketch", "绘画": "Painting", "上半身": "upper body", "全身": "full body", "1girl": "1girl"}, "负面起手": {"超级负面": "multiple breasts, (mutated hands and fingers:1.5 ), (long body :1.3), (mutation, poorly drawn :1.2) , black-white, bad anatomy, liquid body, liquid tongue, disfigured, malformed, mutated, anatomical nonsense, text font ui, error, malformed hands, long neck, blurred, lowers, lowres, bad anatomy, bad proportions, bad shadow, uncoordinated body, unnatural body, fused breasts, bad breasts, huge breasts, poorly drawn breasts, extra breasts, liquid breasts, heavy breasts, missing breasts, huge haunch, huge thighs, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, fused ears, bad ears, poorly drawn ears, extra ears, liquid ears, heavy ears, missing ears, fused animal ears, bad animal ears, poorly drawn animal ears, extra animal ears, liquid animal ears, heavy animal ears, missing animal ears, text, ui, error, missing fingers, missing limb, fused fingers, one hand with more than 5 fingers, one hand with less than 5 fingers, one hand with more than 5 digit, one hand with less than 5 digit, extra digit, fewer digits, fused digit, missing digit, bad digit, liquid digit, colorful tongue, black tongue, cropped, watermark, username, blurry, JPEG artifacts, signature, 3D, 3D game, 3D game scene, 3D character, malformed feet, extra feet, bad feet, poorly drawn feet, fused feet, missing feet, extra shoes, bad shoes, fused shoes, more than two shoes, poorly drawn shoes, bad gloves, poorly drawn gloves, fused gloves, bad cum, poorly drawn cum, fused cum, bad hairs, poorly drawn hairs, fused hairs, big muscles, ugly, bad face, fused face, poorly drawn face, cloned face, big face, long face, bad eyes, fused eyes poorly drawn eyes, extra eyes, malformed limbs, more than 2 nipples, missing nipples, different nipples, fused nipples, bad nipples, poorly drawn nipples, black nipples, colorful nipples, gross proportions. short arm, (((missing arms))), missing thighs, missing calf, missing legs, mutation, duplicate, morbid, mutilated, poorly drawn hands, more than 1 left hand, more than 1 right hand, deformed, (blurry), disfigured, missing legs, extra arms, extra thighs, more than 2 thighs, extra calf, fused calf, extra legs, bad knee, extra knee, more than 2 legs, bad tails, bad mouth, fused mouth, poorly drawn mouth, bad tongue, tongue within mouth, too long tongue, black tongue, big mouth, cracked mouth, bad mouth, dirty face, dirty teeth, dirty pantie, fused pantie, poorly drawn pantie, fused cloth, poorly drawn cloth, bad pantie, yellow teeth, thick lips, bad cameltoe, colorful cameltoe, bad asshole, poorly drawn asshole, fused asshole, missing asshole, bad anus, bad pussy, bad crotch, bad crotch seam, fused anus, fused pussy, fused anus, fused crotch, poorly drawn crotch, fused seam, poorly drawn anus, poorly drawn pussy, poorly drawn crotch, poorly drawn crotch seam, bad thigh gap, missing thigh gap, fused thigh gap, liquid thigh gap, poorly drawn thigh gap, poorly drawn anus, bad collarbone, fused collarbone, missing collarbone, liquid collarbone, strong girl, obesity, worst quality, low quality, normal quality, liquid tentacles, bad tentacles, poorly drawn tentacles, split tentacles, fused tentacles, missing clit, bad clit, fused clit, colorful clit, black clit, liquid clit, QR code, bar code, censored, safety panties, safety knickers, beard, furry ,pony, pubic hair, mosaic, excrement, faeces, shit, futa, testis", "基础负面": "nsfw,logo,text,badhandv4,EasyNegative,ng_deepnegative_v1_75t,rev2-badprompt,verybadimagenegative_v1.3,negative_hand-neg,mutated hands and fingers,poorly drawn face,extra limb,missing limb,disconnected limbs,malformed hands,ugly", "NSFW": "nsfw,logo,text", "embeddings": "badhandv4,EasyNegative,ng_deepnegative_v1_75t,rev2-badprompt,verybadimagenegative_v1.3,negative_hand-neg,bad-picture-chill-75v", "变异手指": "mutated hands and fingers", "畸形的": "deformed", "解剖不良": "bad anatomy", "毁容": "disfigured", "脸不好": "poorly drawn face", "变异的": "mutated", "多余肢体": "extra limb", "丑陋": "ugly", "手画得差": "poorly drawn hands", "缺少的肢体": "missing limb", "漂浮的四肢": "floating limbs", "肢体不连贯": "disconnected limbs", "畸形的手": "malformed hands", "脱离焦点": "out of focus", "长颈": "long neck", "身体长": "long body", "张嘴": "gape"}, "构图视角": {"正面视角": "front view", "侧面视角": "from_side", "从上方↘": "from_above", "从下方↗": "from_below", "全身像": "full_body", "上半身": "upper_body", "下半身": "lower_body", "上半身+上半大腿(牛仔镜头)": "cowboy_shot", "肖像画(脸+肩+偶尔再加胸)": "portrait", "特写": "close-up", "微距摄像": "macro_shot", "近景": "selfie", "自拍视点": "close shot", "多视角分解": "multiple_views", "裙底视角": "phone_screen", "偷窥": "peeking", "偷窥(的姿态)": "peeking_out", "偷窥(强调视角)": "peeping", "从衬衫下方瞥": "upshirt", "从裙底瞥": "upshorts"}, "画风": {"高分辨率(常用)": "highres", "超高分辨率": "absurdres", "极高分辨率": "incredibly_absurdres", "超级高分辨率": "huge_filesize", "壁纸": "wallpaper", "低分辨率": "lowres", "漫画": "comic", "立绘样式": "tachi-e", "官方艺术风格": "official_style", "写实": "realistic", "厚涂(风格)": "painting_(medium)", "厚涂": "Impasto", "照片(风格)": "photo_(medium)", "油画": "oil_painting", "真实": "real", "照片(拍立得)": "polaroid", "传统画布(如纸等)": "traditional_media", "签绘风格": "faux_traditional_media", "马克笔": "marker_(medium)", "马克笔(中性灰色)": "copics", "铅笔速写": "pencil_sketch_lines", "Q版": "chibi", "水墨(国风)": "ink", "水彩": "watercolor", "抱枕": "dakimakura_(medium)", "复古风格": "retro_arfstyle", "四格": "4koma", "赛璐璐": "celluloid", "剪影": "silhouette", "塔罗牌": "tarot", "设定集": "artbook", "杂志封面": "magazine cover", "海报": "poster"}, "构图风格": {"动漫": "Anime", "摄影": "Photographic", "数字艺术": "DigitalArt", "连环漫画": "comic book", "幻想艺术": "fantasyArt", "胶片滤镜": "analog film", "赛博朋克": "cyberpunk", "霓虹朋克": "neon punk", "蒸汽波": "Vaporwave", "等距艺术": "isometric", "低多边形": "low poly", "折纸": "origamiArt", "线条艺术": "lineArt", "电影质感": "cinematic", "像素艺术": "pixelArt", "迷幻艺术": "Psychedelia Art", "酸性风格": "Acid Graphics", "极简主义": "Minimalism", "故障艺术": "Glitch Art", "气泡艺术": "Bubble Art", "玻璃拟态": "Glassmorphism", "新拟物风格": "Neumorphism", "维多利亚风格": "Victorian", "3D插画": "3D graphics", "构成主义(前苏联)": "Constructivism", "动态艺术": "Kinetic Art", "孟菲斯风格": "Memphis"}, "光影": {"电影光效": "cinematic_lighting", "镜头光晕": "lens_flare", "光追": "reality_ray_tracing", "正面光": "frontlight", "侧面光": "sidelight", "背光": "backlight", "逆光": "backlighting", "边缘光": "rim_light", "强边缘光": "strong_rim_light", "自上而下的光线": "god_rays", "明亮的射线光束": "light_rays", "环境光": "ambient_light", "轮廓光": "rim  light", "体积光": "Volumetric  Lighting", "霓虹灯": "glowing  neon  lights", "透镜光晕": "lens  flare", "金属光泽": "metallic  luster", "氛围光照": "moody  lighting", "丁达尔效应": "Tyndall  effect", "漏光光效": "light  leaks", "背景光": "background  light", "自然光": "available  light"}} \ No newline at end of file +{"正面起手":{"简单起手": "best quality,masterpiece", "真实风格起手": "best quality,masterpiece,realistic", "提高质量": "HDR,UHD,8K", "最佳质量": "best quality", "写实": "realistic", "杰作": "masterpiece", "更多细节": "Highly detailed", "简单背景": "simple background", "模糊背景": "blurry background", "演播室灯光": "Studio lighting", "超精细绘画": "ultra-fine painting", "聚焦清晰": "sharp focus", "物理渲染": "physically-based rendering", "极详细刻画": "extreme detail description", "改善细节": "Professional", "添加鲜艳色彩": "Vivid Colors", "虚化模糊景": "Bokeh", "相机设置": "(EOS R8,50mm,F1.2,8K,RAW photo", "老照片": "High resolution scan", "素描": "Sketch", "绘画": "Painting", "上半身": "upper body", "全身": "full body", "1girl": "1girl"}, "负面起手": {"超级负面": "multiple breasts, (mutated hands and fingers:1.5 ), (long body :1.3), (mutation, poorly drawn :1.2) , black-white, bad anatomy, liquid body, liquid tongue, disfigured, malformed, mutated, anatomical nonsense, text font ui, error, malformed hands, long neck, blurred, lowers, lowres, bad anatomy, bad proportions, bad shadow, uncoordinated body, unnatural body, fused breasts, bad breasts, huge breasts, poorly drawn breasts, extra breasts, liquid breasts, heavy breasts, missing breasts, huge haunch, huge thighs, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, fused ears, bad ears, poorly drawn ears, extra ears, liquid ears, heavy ears, missing ears, fused animal ears, bad animal ears, poorly drawn animal ears, extra animal ears, liquid animal ears, heavy animal ears, missing animal ears, text, ui, error, missing fingers, missing limb, fused fingers, one hand with more than 5 fingers, one hand with less than 5 fingers, one hand with more than 5 digit, one hand with less than 5 digit, extra digit, fewer digits, fused digit, missing digit, bad digit, liquid digit, colorful tongue, black tongue, cropped, watermark, username, blurry, JPEG artifacts, signature, 3D, 3D game, 3D game scene, 3D character, malformed feet, extra feet, bad feet, poorly drawn feet, fused feet, missing feet, extra shoes, bad shoes, fused shoes, more than two shoes, poorly drawn shoes, bad gloves, poorly drawn gloves, fused gloves, bad cum, poorly drawn cum, fused cum, bad hairs, poorly drawn hairs, fused hairs, big muscles, ugly, bad face, fused face, poorly drawn face, cloned face, big face, long face, bad eyes, fused eyes poorly drawn eyes, extra eyes, malformed limbs, more than 2 nipples, missing nipples, different nipples, fused nipples, bad nipples, poorly drawn nipples, black nipples, colorful nipples, gross proportions. short arm, (((missing arms))), missing thighs, missing calf, missing legs, mutation, duplicate, morbid, mutilated, poorly drawn hands, more than 1 left hand, more than 1 right hand, deformed, (blurry), disfigured, missing legs, extra arms, extra thighs, more than 2 thighs, extra calf, fused calf, extra legs, bad knee, extra knee, more than 2 legs, bad tails, bad mouth, fused mouth, poorly drawn mouth, bad tongue, tongue within mouth, too long tongue, black tongue, big mouth, cracked mouth, bad mouth, dirty face, dirty teeth, dirty pantie, fused pantie, poorly drawn pantie, fused cloth, poorly drawn cloth, bad pantie, yellow teeth, thick lips, bad cameltoe, colorful cameltoe, bad asshole, poorly drawn asshole, fused asshole, missing asshole, bad anus, bad pussy, bad crotch, bad crotch seam, fused anus, fused pussy, fused anus, fused crotch, poorly drawn crotch, fused seam, poorly drawn anus, poorly drawn pussy, poorly drawn crotch, poorly drawn crotch seam, bad thigh gap, missing thigh gap, fused thigh gap, liquid thigh gap, poorly drawn thigh gap, poorly drawn anus, bad collarbone, fused collarbone, missing collarbone, liquid collarbone, strong girl, obesity, worst quality, low quality, normal quality, liquid tentacles, bad tentacles, poorly drawn tentacles, split tentacles, fused tentacles, missing clit, bad clit, fused clit, colorful clit, black clit, liquid clit, QR code, bar code, censored, safety panties, safety knickers, beard, furry ,pony, pubic hair, mosaic, excrement, faeces, shit, futa, testis", "基础负面": "nsfw,logo,text,badhandv4,EasyNegative,ng_deepnegative_v1_75t,rev2-badprompt,verybadimagenegative_v1.3,negative_hand-neg,mutated hands and fingers,poorly drawn face,extra limb,missing limb,disconnected limbs,malformed hands,ugly", "NSFW": "nsfw,logo,text", "embeddings": "badhandv4,EasyNegative,ng_deepnegative_v1_75t,rev2-badprompt,verybadimagenegative_v1.3,negative_hand-neg,bad-picture-chill-75v", "变异手指": "mutated hands and fingers", "畸形的": "deformed", "解剖不良": "bad anatomy", "毁容": "disfigured", "脸不好": "poorly drawn face", "变异的": "mutated", "多余肢体": "extra limb", "丑陋": "ugly", "手画得差": "poorly drawn hands", "缺少的肢体": "missing limb", "漂浮的四肢": "floating limbs", "肢体不连贯": "disconnected limbs", "畸形的手": "malformed hands", "脱离焦点": "out of focus", "长颈": "long neck", "身体长": "long body", "张嘴": "gape"}, "构图视角": {"正面视角": "front view", "侧面视角": "from_side", "从上方↘": "from_above", "从下方↗": "from_below", "全身像": "full_body", "上半身": "upper_body", "下半身": "lower_body", "上半身+上半大腿(牛仔镜头)": "cowboy_shot", "肖像画(脸+肩+偶尔再加胸)": "portrait", "特写": "close-up", "微距摄像": "macro_shot", "近景": "selfie", "自拍视点": "close shot", "多视角分解": "multiple_views", "裙底视角": "phone_screen", "偷窥": "peeking", "偷窥(的姿态)": "peeking_out", "偷窥(强调视角)": "peeping", "从衬衫下方瞥": "upshirt", "从裙底瞥": "upshorts"}, "画风": {"高分辨率(常用)": "highres", "超高分辨率": "absurdres", "极高分辨率": "incredibly_absurdres", "超级高分辨率": "huge_filesize", "壁纸": "wallpaper", "低分辨率": "lowres", "漫画": "comic", "立绘样式": "tachi-e", "官方艺术风格": "official_style", "写实": "realistic", "厚涂(风格)": "painting_(medium)", "厚涂": "Impasto", "照片(风格)": "photo_(medium)", "油画": "oil_painting", "真实": "real", "照片(拍立得)": "polaroid", "传统画布(如纸等)": "traditional_media", "签绘风格": "faux_traditional_media", "马克笔": "marker_(medium)", "马克笔(中性灰色)": "copics", "铅笔速写": "pencil_sketch_lines", "Q版": "chibi", "水墨(国风)": "ink", "水彩": "watercolor", "抱枕": "dakimakura_(medium)", "复古风格": "retro_arfstyle", "四格": "4koma", "赛璐璐": "celluloid", "剪影": "silhouette", "塔罗牌": "tarot", "设定集": "artbook", "杂志封面": "magazine cover", "海报": "poster"}, "构图风格": {"动漫": "Anime", "摄影": "Photographic", "数字艺术": "DigitalArt", "连环漫画": "comic book", "幻想艺术": "fantasyArt", "胶片滤镜": "analog film", "赛博朋克": "cyberpunk", "霓虹朋克": "neon punk", "蒸汽波": "Vaporwave", "等距艺术": "isometric", "低多边形": "low poly", "折纸": "origamiArt", "线条艺术": "lineArt", "电影质感": "cinematic", "像素艺术": "pixelArt", "迷幻艺术": "Psychedelia Art", "酸性风格": "Acid Graphics", "极简主义": "Minimalism", "故障艺术": "Glitch Art", "气泡艺术": "Bubble Art", "玻璃拟态": "Glassmorphism", "新拟物风格": "Neumorphism", "维多利亚风格": "Victorian", "3D插画": "3D graphics", "构成主义(前苏联)": "Constructivism", "动态艺术": "Kinetic Art", "孟菲斯风格": "Memphis"}, "光影": {"电影光效": "cinematic_lighting", "镜头光晕": "lens_flare", "光追": "reality_ray_tracing", "正面光": "frontlight", "侧面光": "sidelight", "背光": "backlight", "逆光": "backlighting", "边缘光": "rim_light", "强边缘光": "strong_rim_light", "自上而下的光线": "god_rays", "明亮的射线光束": "light_rays", "环境光": "ambient_light", "轮廓光": "rim  light", "体积光": "Volumetric  Lighting", "霓虹灯": "glowing  neon  lights", "透镜光晕": "lens  flare", "金属光泽": "metallic  luster", "氛围光照": "moody  lighting", "丁达尔效应": "Tyndall  effect", "漏光光效": "light  leaks", "背景光": "background  light", "自然光": "available  light"}} \ No newline at end of file diff --git a/json/03服饰.json b/json/03服饰.json index bdd1998..3e55f87 100644 --- a/json/03服饰.json +++ b/json/03服饰.json @@ -1 +1,273 @@ -{"日常服装": {"女式衬衫": "blouse", "有领衬衫": "collared_shirt", "水手服衬衫": "sailor_shirt", "T恤": "t-shirt", "背心(居家)": "tank_top", "背心(正式)": "vest", "休闲": "casual", "卫衣": "hoodie", "居家服": "homewear", "睡衣": "pajamas", "印花睡衣": "print_pajamas", "波点睡衣": "polka_dot_pajamas", "西装外套": "blazer", "大衣": "overcoat", "皮草大衣": "fur_coat", "夹克衫": "jacket", "皮夹克": "leather_jacket", "牛仔夹克": "denim_jacket", "毛衣": "sweater", "高领毛衣": "turtleneck_sweater", "罗纹毛衣": "ribbed_sweater", "毛衣背心": "sweater_vest", "露背毛衣": "backless_sweater", "米色毛衣": "beige_sweater", "棕色毛衣": "brown_sweater", "连帽毛衣": "hooded_sweater", "露肩毛衣": "off-shoulder_sweater", "菱紋毛衣": "ribbed_sweater", "条纹毛衣": "striped_sweater", "处男杀手毛衣": "virgin_killer_sweater", "羽绒服": "puffer_jacket", "雨衣": "raincoat", "连衣裙": "dress", "长连衣裙": "long_dress", "露肩连衣裙": "off-shoulder_dress", "围裙连衣裙": "sweater_dress", "夏日长裙": "summer_dress", "短裙": "skirt", "超短裙": "microskirt", "迷你裙": "miniskirt", "百褶裙": "pleated_skirt", "短铅笔裙": "pencil_skirt", "蓬蓬裙": "bubble_skirt", "芭蕾舞裙": "tutu", "绷紧的连衣裙": "taut_dress", "铅笔裙": "pencil_dress", "牛仔裙": "denim_skirt", "雪紡裙": "chiffon_skirt", "花边裙子": "frilled_skirt", "毛皮镶边短裙": "fur-trimmed_skirt", "蕾絲短裙": "lace_skirt", "缎带饰边短裙": "ribbon-trimmed_skirt", "短裤": "shorts", "条纹短裤": "striped_shorts", "吊带短裤": "suspender_shorts", "牛仔短裤": "denim_shorts", "瑜伽裤": "yoga_pants", "牛仔裤": "jeans", "七分裤": "capri_pants", "灯笼裤": "bloomers"}, "袜子鞋子": {"裸腿": "bare_legs", "裤袜": "pantyhose", "黑丝裤袜": "black_pantyhose", "白丝裤袜": "white_pantyhose", "肉丝裤袜": "nude_pantyhose", "油亮裤袜": "shiny_pantyhose", "有腿环的裤袜": "thighband_pantyhose", "破损的裤袜": "torn_pantyhose", "网袜(材质)": "fishnets", "丝袜": "stockings", "渔网袜": "stirrup_legwear", "长筒袜": "thighhighs", "白色长筒袜": "white_thighhighs", "黑色长筒袜": "black_thighhighs", "粉色长筒袜": "pink_thighhighs", "吊带袜": "garter_straps", "腰带(吊带袜的)": "garter_straps", "损坏了的长筒袜": "torn_thighhighs", "透明的袜子": "see-through_legwear", "花边袜": "frilled_legwear", "蕾丝边袜": "lace-trimmed_legwear", "泡泡袜": "loose_socks", "踝袜": "ankle_socks", "腿套|暖腿袜": "leg_warmers", "横条短袜": "striped_socks", "连体黑丝": "black_bodystocking", "连体白丝": "white_bodystocking", "赤脚": "barefoot", "没有鞋子": "no_shoes", "脱下的鞋子": "shoes_removed", "单鞋": "the_only_shoe", "脱下的鞋": "shoes_removed", "一只脚没穿鞋子": "single_shoe", "高跟鞋": "high_heels", "运动鞋": "sneakers", "裸足凉鞋": "barefoot_sandals", "木屐凉鞋": "clog_sandals", "乐福鞋(小皮鞋)": "black_loafers", "靴子": "boots", "大腿靴": "thigh_boots", "高跟靴": "high_heel_boots", "雪地靴": "snow_boots", "皮靴": "leather_boots", "马丁靴": "doc_martens", "旱冰鞋": "roller_skates", "脚环": "anklet", "镣铐": "shackles"}, "佩饰道具": {"颈部饰品": "choker", "黑色颈圈": "black_choker", "领巾": "neckerchief", "红领巾": "red_neckerchief", "领带": "necktie", "蝴蝶结领带": "bowtie", "挂在脖子上的耳机": "headphones_around_neck", "脖子上护目镜": "goggles_around_neck", "颈铃": "neck_bell", "颈部纹身": "neck_tattoo", "十字架项链": "cross_necklace", "珍珠项链": "pearl_necklace", "心形项链": "labcoat", "骷髅项链": "skull_necklace", "花项链": "flower_necklace", "贝壳项链": "shell_necklace", "金项链": "gold_necklace", "羽毛项链": "feather_necklace", "格子围巾": "plaid_scarf", "条纹围巾": "striped_scarf", "格纹围巾": "checkered_scarf", "印花围巾": "print_scarf", "波点围巾": "polka_dot_scarf", "披肩": "capelet", "棒球帽": "Baseball  cap", "针织帽": "Beanie", "遮阳帽": "Visor  cap", "圆顶礼帽": "Bowler  hat", "侦探帽": "Fedora", "牛仔帽": "Cowboy  hat", "厨师帽": "Chef  hat", "军官帽": "Military  hat", "圣诞帽": "Santa  hat", "派对帽": "Party  hat", "小丑帽": "Jester  cap", "女巫帽": "witch  hat", "贝雷帽": "beret", "鸭舌帽": "peaked  cap", "草帽": "Straw  hat"}, "制服COS": {"职场制服": "business_suit", "校服": "school_uniform", "水手服": "serafuku", "护士": "nurse", "警服": "police_uniform", "海军制服": "naval_uniform", "陆军制服": "military_uniform", "女仆装": "maid", "围裙": "apron", "厨师工装": "chef_uniform", "宇航服": "space_suit", "实验服": "labcoat", "啦啦队服": "cheerleader", "燕尾服": "tuxedo", "礼服": "evening_gown", "婚纱": "wedding_dress", "巫女服": "miko", "修女服": "nun_cloth", "兔子服装": "bunny_costume", "猫系服装": "cat_costume", "皮套狗": "dog_costume", "熊套装": "bear_costume", "圣诞风格服装": "santa_costume", "盔甲": "armor", "比基尼盔甲": "bikini_armor", "穿着全套盔甲的": "full_armor", "板甲": "plate_armor", "日本铠甲": "japanese_armor", "动力装甲": "power_armor", "机甲": "mecha", "头盔": "helmet", "头盔(日式)": "kabuto", "無肩甲盔甲": "off-shoulder_armor", "肩甲": "shoulder_armor", "日本弓道護胸甲": "muneate", "胸甲": "breastplate", "腹甲": "faulds", "胫甲": "shin_guards", "装甲靴": "armored_boots", "道袍": "Taoist robe", "长袍": "robe", "混合长袍": "robe_of_blending", "斗篷": "cloak", "羽衣": "hagoromo"}, "传统服饰": {"中国服饰": "china_dress", "中国风": "chinese_style", "旗袍": "china_dress", "印花旗袍": "print_cheongsam", "汉服": "hanfu", "汉服唐风": "hanfu, tang style", "上杉": "upper shan", "长上杉": "long upper shan", "齐胸破裙": "chest po skirt", "齐胸褶裙": "chest pleated skirt", "系带": "waistband", "披帛": "pibo", "汉服宋风": "hanfu, song style outfits", "短杉": "short shan", "长杉": "long shan", "宋抹": "songmo", "百褶裙": "pleated skirt", "汉服明风": "hanfu, ming style outfits", "短袄": "short coat", "长袄": "long coat", "马面裙": "mamian skirt", "交领": "overlapping collar", "圆领": "round collar", "立领": "standing collar", "方领": "square collar", "云肩": "overlapping collar", "刺绣": "embroidery", "织金": "woven gold", "妆花": "makeup flower", "补服": "bufu", "和服": "kimono", "印花和服": "print_kimono", "衣带(和服用)": "obi", "浴衣": "yukata", "韩服": "hanbok", "朝鲜服饰": "korean_clothes", "西部风格": "western", "德国服装": "german_clothes", "哥特风格": "gothic", "洛丽塔风格": "gothic_lolita", "拜占庭风格": "byzantine_fashion", "热带特征的": "Tropical", "印度风格": "indian_style", "越南校服(奥黛)": "Ao_Dai", "阿伊努人的服饰": "ainu_clothes", "阿拉伯服饰": "arabian_clothes", "埃及风格服饰": "egyptian_clothes"}, "运动泳装": {"运动服": "gym_uniform", "体操服": "athletic_leotard", "足球服": "volleyball_uniform", "网球衫": "tennis_uniform", "棒球服": "baseball_uniform", "棒球夹克": "letterman_jacket", "排球服": "volleyball_uniform", "骑行套装": "bikesuit", "泳装": "swimsuit", "学校泳装(死库水)": "school_swimsuit", "赛用泳衣": "competition_swimsuit", "连体泳衣": "casual_one-piece_swimsuit", "高开衩的泳衣": "highleg_swimsuit", "一体式泳衣": "one-piece_swimsuit", "比基尼": "bikini", "微比基尼": "micro_bikini", "女仆比基尼": "maid_bikini", "水手服款比基尼": "sailor_bikini", "贝壳比基尼": "shell_bikini", "运动比基尼": "sports_bikini", "系绳比基尼": "string_bikini"}} \ No newline at end of file +{ + "日常服装": { + "女式衬衫": "blouse", + "有领衬衫": "collared_shirt", + "水手服衬衫": "sailor_shirt", + "T恤": "t-shirt", + "背心(居家)": "tank_top", + "背心(正式)": "vest", + "休闲": "casual", + "卫衣": "hoodie", + "居家服": "homewear", + "睡衣": "pajamas", + "印花睡衣": "print_pajamas", + "波点睡衣": "polka_dot_pajamas", + "西装外套": "blazer", + "大衣": "overcoat", + "皮草大衣": "fur_coat", + "夹克衫": "jacket", + "皮夹克": "leather_jacket", + "牛仔夹克": "denim_jacket", + "毛衣": "sweater", + "高领毛衣": "turtleneck_sweater", + "罗纹毛衣": "ribbed_sweater", + "毛衣背心": "sweater_vest", + "露背毛衣": "backless_sweater", + "米色毛衣": "beige_sweater", + "棕色毛衣": "brown_sweater", + "连帽毛衣": "hooded_sweater", + "露肩毛衣": "off-shoulder_sweater", + "菱紋毛衣": "ribbed_sweater", + "条纹毛衣": "striped_sweater", + "处男杀手毛衣": "virgin_killer_sweater", + "羽绒服": "puffer_jacket", + "雨衣": "raincoat", + "连衣裙": "dress", + "长连衣裙": "long_dress", + "露肩连衣裙": "off-shoulder_dress", + "围裙连衣裙": "sweater_dress", + "夏日长裙": "summer_dress", + "短裙": "skirt", + "超短裙": "microskirt", + "迷你裙": "miniskirt", + "百褶裙": "pleated_skirt", + "短铅笔裙": "pencil_skirt", + "蓬蓬裙": "bubble_skirt", + "芭蕾舞裙": "tutu", + "绷紧的连衣裙": "taut_dress", + "铅笔裙": "pencil_dress", + "牛仔裙": "denim_skirt", + "雪紡裙": "chiffon_skirt", + "花边裙": "frilled_skirt", + "分层裙": "layered skirts", + "毛皮镶边短裙": "fur-trimmed_skirt", + "蕾絲短裙": "lace_skirt", + "缎带饰边短裙": "ribbon-trimmed_skirt", + "短裤": "shorts", + "条纹短裤": "striped_shorts", + "吊带短裤": "suspender_shorts", + "牛仔短裤": "denim_shorts", + "瑜伽裤": "yoga_pants", + "牛仔裤": "jeans", + "七分裤": "capri_pants", + "灯笼裤": "bloomers" + }, + "袜子鞋子": { + "裸腿": "bare_legs", + "裤袜": "pantyhose", + "黑丝裤袜": "black_pantyhose", + "白丝裤袜": "white_pantyhose", + "肉丝裤袜": "nude_pantyhose", + "油亮裤袜": "shiny_pantyhose", + "有腿环的裤袜": "thighband_pantyhose", + "破损的裤袜": "torn_pantyhose", + "网袜(材质)": "fishnets", + "丝袜": "stockings", + "渔网袜": "stirrup_legwear", + "长筒袜": "thighhighs", + "白色长筒袜": "white_thighhighs", + "黑色长筒袜": "black_thighhighs", + "粉色长筒袜": "pink_thighhighs", + "吊带袜": "garter_straps", + "腰带(吊带袜的)": "garter_straps", + "损坏了的长筒袜": "torn_thighhighs", + "透明的袜子": "see-through_legwear", + "花边袜": "frilled_legwear", + "蕾丝边袜": "lace-trimmed_legwear", + "泡泡袜": "loose_socks", + "踝袜": "ankle_socks", + "腿套|暖腿袜": "leg_warmers", + "横条短袜": "striped_socks", + "连体黑丝": "black_bodystocking", + "连体白丝": "white_bodystocking", + "赤脚": "barefoot", + "没有鞋子": "no_shoes", + "脱下的鞋子": "shoes_removed", + "单鞋": "the_only_shoe", + "脱下的鞋": "shoes_removed", + "一只脚没穿鞋子": "single_shoe", + "高跟鞋": "high_heels", + "运动鞋": "sneakers", + "裸足凉鞋": "barefoot_sandals", + "木屐凉鞋": "clog_sandals", + "乐福鞋(小皮鞋)": "black_loafers", + "靴子": "boots", + "大腿靴": "thigh_boots", + "高跟靴": "high_heel_boots", + "雪地靴": "snow_boots", + "皮靴": "leather_boots", + "马丁靴": "doc_martens", + "旱冰鞋": "roller_skates", + "脚环": "anklet", + "镣铐": "shackles" + }, + "佩饰道具": { + "颈部饰品": "choker", + "黑色颈圈": "black_choker", + "领巾": "neckerchief", + "红领巾": "red_neckerchief", + "领带": "necktie", + "蝴蝶结领带": "bowtie", + "挂在脖子上的耳机": "headphones_around_neck", + "脖子上护目镜": "goggles_around_neck", + "颈铃": "neck_bell", + "颈部纹身": "neck_tattoo", + "十字架项链": "cross_necklace", + "珍珠项链": "pearl_necklace", + "心形项链": "labcoat", + "骷髅项链": "skull_necklace", + "花项链": "flower_necklace", + "贝壳项链": "shell_necklace", + "金项链": "gold_necklace", + "羽毛项链": "feather_necklace", + "格子围巾": "plaid_scarf", + "条纹围巾": "striped_scarf", + "格纹围巾": "checkered_scarf", + "印花围巾": "print_scarf", + "波点围巾": "polka_dot_scarf", + "披肩": "capelet", + "棒球帽": "Baseball  cap", + "针织帽": "Beanie", + "遮阳帽": "Visor  cap", + "圆顶礼帽": "Bowler  hat", + "侦探帽": "Fedora", + "牛仔帽": "Cowboy  hat", + "厨师帽": "Chef  hat", + "军官帽": "Military  hat", + "圣诞帽": "Santa  hat", + "派对帽": "Party  hat", + "小丑帽": "Jester  cap", + "女巫帽": "witch  hat", + "贝雷帽": "beret", + "鸭舌帽": "peaked  cap", + "草帽": "Straw  hat" + }, + "制服COS": { + "职场制服": "business_suit", + "校服": "school_uniform", + "水手服": "serafuku", + "护士": "nurse", + "警服": "police_uniform", + "海军制服": "naval_uniform", + "陆军制服": "military_uniform", + "女仆装": "maid", + "围裙": "apron", + "厨师工装": "chef_uniform", + "宇航服": "space_suit", + "实验服": "labcoat", + "啦啦队服": "cheerleader", + "燕尾服": "tuxedo", + "礼服": "evening_gown", + "婚纱": "wedding_dress", + "巫女服": "miko", + "修女服": "nun_cloth", + "兔子服装": "bunny_costume", + "猫系服装": "cat_costume", + "皮套狗": "dog_costume", + "熊套装": "bear_costume", + "圣诞风格服装": "santa_costume", + "盔甲": "armor", + "比基尼盔甲": "bikini_armor", + "穿着全套盔甲的": "full_armor", + "板甲": "plate_armor", + "日本铠甲": "japanese_armor", + "动力装甲": "power_armor", + "机甲": "mecha", + "头盔": "helmet", + "头盔(日式)": "kabuto", + "無肩甲盔甲": "off-shoulder_armor", + "肩甲": "shoulder_armor", + "日本弓道護胸甲": "muneate", + "胸甲": "breastplate", + "腹甲": "faulds", + "胫甲": "shin_guards", + "装甲靴": "armored_boots", + "道袍": "Taoist robe", + "长袍": "robe", + "混合长袍": "robe_of_blending", + "斗篷": "cloak", + "羽衣": "hagoromo" + }, + "传统服饰": { + "中国服饰": "china_dress", + "中国风": "chinese_style", + "旗袍": "china_dress", + "印花旗袍": "print_cheongsam", + "汉服": "hanfu", + "汉服唐风": "hanfu, tang style", + "上杉": "upper shan", + "长上杉": "long upper shan", + "齐胸破裙": "chest po skirt", + "齐胸褶裙": "chest pleated skirt", + "系带": "waistband", + "披帛": "pibo", + "汉服宋风": "hanfu, song style outfits", + "短杉": "short shan", + "长杉": "long shan", + "宋抹": "songmo", + "百褶裙": "pleated skirt", + "汉服明风": "hanfu, ming style outfits", + "短袄": "short coat", + "长袄": "long coat", + "马面裙": "mamian skirt", + "交领": "overlapping collar", + "圆领": "round collar", + "立领": "standing collar", + "方领": "square collar", + "云肩": "overlapping collar", + "刺绣": "embroidery", + "织金": "woven gold", + "妆花": "makeup flower", + "补服": "bufu", + "和服": "kimono", + "印花和服": "print_kimono", + "衣带(和服用)": "obi", + "浴衣": "yukata", + "韩服": "hanbok", + "朝鲜服饰": "korean_clothes", + "西部风格": "western", + "德国服装": "german_clothes", + "哥特风格": "gothic", + "洛丽塔风格": "gothic_lolita", + "拜占庭风格": "byzantine_fashion", + "热带特征的": "Tropical", + "印度风格": "indian_style", + "越南校服(奥黛)": "Ao_Dai", + "阿伊努人的服饰": "ainu_clothes", + "阿拉伯服饰": "arabian_clothes", + "埃及风格服饰": "egyptian_clothes" + }, + "运动泳装": { + "运动服": "gym_uniform", + "体操服": "athletic_leotard", + "足球服": "volleyball_uniform", + "网球衫": "tennis_uniform", + "棒球服": "baseball_uniform", + "棒球夹克": "letterman_jacket", + "排球服": "volleyball_uniform", + "骑行套装": "bikesuit", + "泳装": "swimsuit", + "学校泳装(死库水)": "school_swimsuit", + "赛用泳衣": "competition_swimsuit", + "连体泳衣": "casual_one-piece_swimsuit", + "高开衩的泳衣": "highleg_swimsuit", + "一体式泳衣": "one-piece_swimsuit", + "比基尼": "bikini", + "微比基尼": "micro_bikini", + "女仆比基尼": "maid_bikini", + "水手服款比基尼": "sailor_bikini", + "贝壳比基尼": "shell_bikini", + "运动比基尼": "sports_bikini", + "系绳比基尼": "string_bikini" + } +} \ No newline at end of file diff --git a/scripts/__pycache__/old_six_prompt.cpython-310.pyc b/scripts/__pycache__/old_six_prompt.cpython-310.pyc index 6d34ec6..7231cbb 100644 Binary files a/scripts/__pycache__/old_six_prompt.cpython-310.pyc and b/scripts/__pycache__/old_six_prompt.cpython-310.pyc differ diff --git a/scripts/old_six_prompt.py b/scripts/old_six_prompt.py index 32acf08..94cffea 100644 --- a/scripts/old_six_prompt.py +++ b/scripts/old_six_prompt.py @@ -3,6 +3,7 @@ import gradio as gr import os,json import json import random +import re current_script = os.path.realpath(__file__) current_folder = os.path.dirname(current_script) @@ -18,7 +19,8 @@ def LoadTagsFile(): def loadjsonfiles(path,dic): files = os.listdir( path ) - for item in files: + sorted_files = sorted(files) + for item in sorted_files: if item.endswith(".json"): filepath=path+'/'+item filename=filepath[filepath.rindex('/') + 1:-5] @@ -62,7 +64,7 @@ class Script(scripts.Script): eid='oldsix-prompt1' tid='oldsix-area1' with gr.Row(elem_id=eid): - with gr.Accordion(label="SixGod_K提示词",open=False): + with gr.Accordion(label="SixGod_K提示词 v1.31",open=False): textarea=gr.TextArea(self.json,elem_id=tid,visible=False) with gr.Column(scale=4,elem_id="oldsix-optit"): btnreload=gr.Button('🔄',elem_classes="oldsix-reload sm secondary gradio-button svelte-1ipelgc") @@ -75,9 +77,9 @@ class Script(scripts.Script): rdtextareaZh=gr.TextArea(label='预览框',elem_id='randomTextZh',lines=3) with gr.Row(): with gr.Column(scale=4): - gr.Textbox(placeholder='开头占位提示词',show_label=False,elem_classes="oldsix-txt-start") + txtstart=gr.Textbox(placeholder='开头占位提示词',show_label=False,elem_classes="oldsix-txt-start") with gr.Column(scale=4): - gr.Textbox(placeholder='结尾占位提示词',show_label=False,elem_classes="oldsix-txt-end") + txtend=gr.Textbox(placeholder='结尾占位提示词',show_label=False,elem_classes="oldsix-txt-end") with gr.Row(): with gr.Column(scale=4): btnRandom=gr.Button('随机灵感关键词',variant="primary") @@ -88,22 +90,43 @@ class Script(scripts.Script): def randomPrompt(): - self.randomIndex= random.randint(0,len(self.rdlist)) - return [self.rdlist[self.randomIndex]['val'],self.rdlist[self.randomIndex]['key']] + random.seed(getSeed()) + self.randomIndex= random.randint(0,len(self.rdlist)-1) + rden=self.rdlist[self.randomIndex]['key'] + return [self.rdlist[self.randomIndex]['val'],rden] def reloadData(): return LoadTagsFile() btnreload.click(fn=reloadData,inputs=None,outputs=textarea) btnRandom.click(fn=randomPrompt,inputs=None,outputs=[rdtextareaEn,rdtextareaZh]) - - - + return [btnreload] - # def process(self, p, *args): - # pass + def process(self, p, *args): + rdtext= extract_hash_tags(p.prompt) + if(rdtext): + for i in range(len(p.all_prompts)): + p.all_prompts[i]=rdtext + + - - + +def extract_hash_tags(text): + pattern = r'#\[(.*?)\]' + matches = re.findall(pattern, text) + if(len(matches)==0) : + return None + for item in matches: + arr=item.split(',') + random.seed(getSeed()) + rdindex=random.randint(0,len(arr)-1) + rdtext=arr[rdindex] + text = re.sub(pattern, rdtext, text,count=1) + + return text +def getSeed(): + seed = random.random() + return seed +