Skip to content

Commit

Permalink
update: webui version
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekoer committed Oct 15, 2022
1 parent 1b2c1b5 commit fe5cef3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "com.hcyacg"
version = "0.6.0"
version = "0.7.0"

repositories {
maven("https://maven.aliyun.com/repository/public")
Expand Down
17 changes: 11 additions & 6 deletions src/main/kotlin/Generate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public object Generate {



val data = PostData(data = arrayOf(if(!translated) tags else tags.split(",").joinToString(",") {translate(it)},
val data = PostData(data = arrayOf(
if(!translated) tags else tags.split(",").joinToString(",") {translate(it)},
Config.negativePrompt,
Config.promptStyle,
Config.promptStyle2,
Expand All @@ -77,9 +78,11 @@ public object Generate {
Config.seedEnableExtras,
Config.height,
Config.width,
Config.enableHr,
Config.scaleLatent,
Config.enableHr,//
// 0.7,
// Config.scaleLatent,
Config.denoisingStrength,
0,0,
Config.script,
Config.putVariablePartsAtStartOfPrompt,
false,
Expand All @@ -91,6 +94,7 @@ public object Generate {
Config.yvalues,
Config.drawLegend,
Config.keepRandomSeeds,
false,
null,
"",""),fn_index=Config.textFnIndex,session_hash = randomString)

Expand Down Expand Up @@ -227,6 +231,7 @@ public object Generate {
Config.yvalues,
Config.drawLegend,
Config.keepRandomSeeds,
false,
null,
"",""),fn_index=Config.imageFnIndex,session_hash = randomString)

Expand Down Expand Up @@ -273,17 +278,17 @@ public object Generate {
}

private fun translateChinese(text: String): String {
try{
return try{
val request = Request.Builder().apply {
url("https://fanyi.youdao.com/translate?&doctype=json&type=AUTO&i=${text}")
get()
}.build()

val result = json.decodeFromString<TranslateResult>(client.newCall(request).execute().body!!.string())
return result.translateResult[0][0].tgt
result.translateResult[0][0].tgt
}catch(e:Exception){
logger.error("调用有道翻译错误")
return ""
""
}
}

Expand Down
14 changes: 12 additions & 2 deletions src/main/kotlin/Novelai.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public object Novelai : KotlinPlugin(
JvmPluginDescription(
id = "com.hcyacg.novelai",
name = "novelai",
version = "0.6.0",
version = "0.7.0",
) {
author("Nekoer")
}
Expand Down Expand Up @@ -53,7 +53,6 @@ public object Novelai : KotlinPlugin(
}
content { message.contentToString().contains("/ai seed ") } quoteReply {
try {

Config.seed = message.contentToString().replace("/ai seed ","").toLong()
Config.save()
"随机数种子已经设置为${Config.seed}"
Expand All @@ -73,6 +72,17 @@ public object Novelai : KotlinPlugin(
"翻译已${if(Config.translated)"开启" else "关闭"}"
}
}
content { message.contentToString().contains("/ai url ") } quoteReply {
try{
Config.stableDiffusionWebui = message.contentToString().replace("/ai url ","")
Config.save()
"源站已更改为${Config.stableDiffusionWebui}"
}catch (e:Exception){
e.printStackTrace()
"更改错误"
}

}
}
}
}
4 changes: 2 additions & 2 deletions src/main/kotlin/config/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public object Config : AutoSavePluginConfig("config") {

@ValueName("imageFnIndex")
@ValueDescription("接口id")
public var imageFnIndex:Int by value(31)
public var imageFnIndex:Int by value(33)

@ValueName("mode")
@ValueDescription("模式,仅限image2image")
Expand Down Expand Up @@ -69,7 +69,7 @@ public object Config : AutoSavePluginConfig("config") {

@ValueName("negativePrompt")
@ValueDescription("过滤词条")
public var negativePrompt: String by value("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")
public var negativePrompt: String by value("multiple breasts, bad anatomy, liquid body, liquid tongue, disfigured, mutated, anatomical nonsense, text font ui, error, malformed hands, long neck, blurred, lowers,bad anatomy, bad proportions, bad shadow, uncoordinated body, unnatural body, fused breasts, bad breasts, huge breasts, poorly drawn breasts, extra breasts, liquid 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 earsblurry, 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,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")

@ValueName("promptStyle")
@ValueDescription("词条风格")
Expand Down

0 comments on commit fe5cef3

Please sign in to comment.