Vivawaves commited on
Commit
b841720
·
1 Parent(s): 084ab51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -15
app.py CHANGED
@@ -12,16 +12,16 @@ from previewer.modules import Previewer
12
 
13
  from gallery_history import fetch_gallery_history, show_gallery_history
14
 
15
- os.environ['TOKENIZERS_PARALLELISM'] = 'false'
16
 
17
- DESCRIPTION = "# Würstchen"
18
- DESCRIPTION += "\n<p style=\"text-align: center\"><a href='https://huggingface.co/warp-ai/wuerstchen' target='_blank'>Würstchen</a> is a new fast and efficient high resolution text-to-image architecture and model</p>"
19
  if not torch.cuda.is_available():
20
  DESCRIPTION += "\n<p>Running on CPU 🥶</p>"
21
 
22
  MAX_SEED = np.iinfo(np.int32).max
23
  CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES") == "1"
24
- MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "1536"))
25
  USE_TORCH_COMPILE = False
26
  ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD") == "1"
27
  PREVIEW_IMAGES = True
@@ -114,10 +114,6 @@ def generate(
114
  yield decoder_output
115
 
116
 
117
- examples = [
118
- "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
119
- "An astronaut riding a green horse",
120
- ]
121
 
122
  with gr.Blocks(css="style.css") as demo:
123
  gr.Markdown(DESCRIPTION)
@@ -132,16 +128,16 @@ with gr.Blocks(css="style.css") as demo:
132
  label="Prompt",
133
  show_label=False,
134
  max_lines=1,
135
- placeholder="Enter your prompt",
136
  container=False,
137
  )
138
- run_button = gr.Button("Run", scale=0)
139
  result = gr.Gallery(label="Result", show_label=False)
140
  with gr.Accordion("Advanced options", open=False):
141
  negative_prompt = gr.Text(
142
- label="Negative prompt",
143
  max_lines=1,
144
- placeholder="Enter a Negative Prompt",
145
  )
146
 
147
  seed = gr.Slider(
@@ -155,14 +151,14 @@ with gr.Blocks(css="style.css") as demo:
155
  with gr.Row():
156
  width = gr.Slider(
157
  label="Width",
158
- minimum=1024,
159
  maximum=MAX_IMAGE_SIZE,
160
  step=512,
161
  value=1024,
162
  )
163
  height = gr.Slider(
164
  label="Height",
165
- minimum=1024,
166
  maximum=MAX_IMAGE_SIZE,
167
  step=512,
168
  value=1024,
@@ -170,7 +166,7 @@ with gr.Blocks(css="style.css") as demo:
170
  num_images_per_prompt = gr.Slider(
171
  label="Number of Images",
172
  minimum=1,
173
- maximum=2,
174
  step=1,
175
  value=2,
176
  )
@@ -215,6 +211,7 @@ with gr.Blocks(css="style.css") as demo:
215
 
216
  history = show_gallery_history()
217
 
 
218
  inputs = [
219
  prompt,
220
  negative_prompt,
 
12
 
13
  from gallery_history import fetch_gallery_history, show_gallery_history
14
 
15
+ os.environ['TOKENIZERS_PARALLELISM'] = 'true'
16
 
17
+ DESCRIPTION = "# Waves Weaves"
18
+ DESCRIPTION += "\n<p style=\"text-align: center\"></p>"
19
  if not torch.cuda.is_available():
20
  DESCRIPTION += "\n<p>Running on CPU 🥶</p>"
21
 
22
  MAX_SEED = np.iinfo(np.int32).max
23
  CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES") == "1"
24
+ MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "2048"))
25
  USE_TORCH_COMPILE = False
26
  ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD") == "1"
27
  PREVIEW_IMAGES = True
 
114
  yield decoder_output
115
 
116
 
 
 
 
 
117
 
118
  with gr.Blocks(css="style.css") as demo:
119
  gr.Markdown(DESCRIPTION)
 
128
  label="Prompt",
129
  show_label=False,
130
  max_lines=1,
131
+ placeholder="Imagine...",
132
  container=False,
133
  )
134
+ run_button = gr.Button("Weave", scale=0)
135
  result = gr.Gallery(label="Result", show_label=False)
136
  with gr.Accordion("Advanced options", open=False):
137
  negative_prompt = gr.Text(
138
+ label="What I do NOT want",
139
  max_lines=1,
140
+ placeholder="Example: Deformed limbs, Deformed faces",
141
  )
142
 
143
  seed = gr.Slider(
 
151
  with gr.Row():
152
  width = gr.Slider(
153
  label="Width",
154
+ minimum=512,
155
  maximum=MAX_IMAGE_SIZE,
156
  step=512,
157
  value=1024,
158
  )
159
  height = gr.Slider(
160
  label="Height",
161
+ minimum=512,
162
  maximum=MAX_IMAGE_SIZE,
163
  step=512,
164
  value=1024,
 
166
  num_images_per_prompt = gr.Slider(
167
  label="Number of Images",
168
  minimum=1,
169
+ maximum=5,
170
  step=1,
171
  value=2,
172
  )
 
211
 
212
  history = show_gallery_history()
213
 
214
+
215
  inputs = [
216
  prompt,
217
  negative_prompt,