thefcraft commited on
Commit
88c1875
·
1 Parent(s): 13745a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -56,17 +56,17 @@ def generateText(model, minLen=100, size=5):
56
 
57
  return output
58
 
59
- def sentence_builder(quantity, Type, negative):
60
  if Type == "NSFW": idx=1
61
  elif Type == "SFW": idx=2
62
  else: idx=0
63
  model = models[idx]
64
  output = ""
65
  for i in range(quantity):
66
- prompt = generateText(model[0], minLen=300, size=1)[0]
67
  output+=f"PROMPT: {prompt}\n\n"
68
  if negative:
69
- negative_prompt = generateText(model[1], minLen=300, size=5)[0]
70
  output+=f"NEGATIVE PROMPT: {negative_prompt}\n"
71
  output+="----------------------------------------------------------------"
72
  output+="\n\n\n"
@@ -78,6 +78,7 @@ ui = gr.Interface(
78
  sentence_builder,
79
  [
80
  gr.Slider(1, 10, value=4, label="Count", info="Choose between 1 and 10", step=1),
 
81
  gr.Radio(["NSFW", "SFW", "BOTH"], label="TYPE", info="NSFW stands for NOT SAFE FOR WORK, so choose any one you want?"),
82
  gr.Checkbox(label="negitive Prompt", info="Do you want to generate negative prompt as well as prompt?"),
83
  ],
 
56
 
57
  return output
58
 
59
+ def sentence_builder(quantity, minLen, Type, negative):
60
  if Type == "NSFW": idx=1
61
  elif Type == "SFW": idx=2
62
  else: idx=0
63
  model = models[idx]
64
  output = ""
65
  for i in range(quantity):
66
+ prompt = generateText(model[0], minLen=minLen, size=1)[0]
67
  output+=f"PROMPT: {prompt}\n\n"
68
  if negative:
69
+ negative_prompt = generateText(model[1], minLen=minLen, size=5)[0]
70
  output+=f"NEGATIVE PROMPT: {negative_prompt}\n"
71
  output+="----------------------------------------------------------------"
72
  output+="\n\n\n"
 
78
  sentence_builder,
79
  [
80
  gr.Slider(1, 10, value=4, label="Count", info="Choose between 1 and 10", step=1),
81
+ gr.Slider(100, 1000, value=300, label="minLen", info="Choose between 100 and 1000", step=50),
82
  gr.Radio(["NSFW", "SFW", "BOTH"], label="TYPE", info="NSFW stands for NOT SAFE FOR WORK, so choose any one you want?"),
83
  gr.Checkbox(label="negitive Prompt", info="Do you want to generate negative prompt as well as prompt?"),
84
  ],