panelforge commited on
Commit
656c92b
·
verified ·
1 Parent(s): 38e9bf1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -8
app.py CHANGED
@@ -21,11 +21,10 @@ pipe = pipe.to(device)
21
  MAX_SEED = np.iinfo(np.int32).max
22
  MAX_IMAGE_SIZE = 1024
23
 
24
-
25
  @spaces.GPU #[uncomment to use ZeroGPU]
26
  def infer(
27
- prompt,
28
- negative_prompt,
29
  seed,
30
  randomize_seed,
31
  width,
@@ -101,6 +100,18 @@ with gr.Blocks(css=css) as demo:
101
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
102
 
103
  with gr.Row():
 
 
 
 
 
 
 
 
 
 
 
 
104
  width = gr.Slider(
105
  label="Width",
106
  minimum=256,
@@ -120,17 +131,17 @@ with gr.Blocks(css=css) as demo:
120
  with gr.Row():
121
  guidance_scale = gr.Slider(
122
  label="Guidance scale",
123
- minimum=0.0,
124
- maximum=10.0,
125
  step=0.1,
126
  value=0.0, # Replace with defaults that work for your model
127
  )
128
 
129
  num_inference_steps = gr.Slider(
130
  label="Number of inference steps",
131
- minimum=1,
132
- maximum=50,
133
- step=1,
134
  value=2, # Replace with defaults that work for your model
135
  )
136
 
 
21
  MAX_SEED = np.iinfo(np.int32).max
22
  MAX_IMAGE_SIZE = 1024
23
 
 
24
  @spaces.GPU #[uncomment to use ZeroGPU]
25
  def infer(
26
+ positive_prefix + prompt,
27
+ negative_prefix + negative_prompt,
28
  seed,
29
  randomize_seed,
30
  width,
 
100
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
101
 
102
  with gr.Row():
103
+ positive_prefix = gr.Text(
104
+ label="Positive prompt prefix",
105
+ placeholder="e.g., masterpiece, best quality, amazing quality, ",
106
+ value="masterpiece, best quality, amazing quality,"
107
+ )
108
+
109
+ negative_prefix = gr.Text(
110
+ label="Negative prompt prefix",
111
+ placeholder="e.g., bad quality, worst quality, worst detail, sketch, censor, ",
112
+ value="bad quality, worst quality, worst detail, sketch, censor, "
113
+ )
114
+
115
  width = gr.Slider(
116
  label="Width",
117
  minimum=256,
 
131
  with gr.Row():
132
  guidance_scale = gr.Slider(
133
  label="Guidance scale",
134
+ minimum=5.0,
135
+ maximum=7.0,
136
  step=0.1,
137
  value=0.0, # Replace with defaults that work for your model
138
  )
139
 
140
  num_inference_steps = gr.Slider(
141
  label="Number of inference steps",
142
+ minimum=15,
143
+ maximum=30,
144
+ step=15,
145
  value=2, # Replace with defaults that work for your model
146
  )
147