piyk commited on
Commit
07996f0
·
verified ·
1 Parent(s): 9e50379

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -15,9 +15,6 @@ from diffusers import AutoencoderKL, DiffusionPipeline
15
  DESCRIPTION = """
16
  # OpenDalle 1.1
17
  """
18
- if not torch.cuda.is_available():
19
- DESCRIPTION += "\n<h1>Running on CPU 🥶 This demo does not work on CPU. Please use <a href=\"https://huggingface.co/spaces/mrfakename/OpenDalleV1.1-GPU-Demo\">the online demo</a> instead</h1>"
20
-
21
  MAX_SEED = np.iinfo(np.int32).max
22
  CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "0") == "1"
23
  MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "1024"))
@@ -137,25 +134,28 @@ examples = [
137
  "Realistic image of Thai temple in front of Sunlight, the scene extreme closeup, background in forest"
138
  ]
139
 
140
- theme = gr.themes.Base(
141
- font=[gr.themes.GoogleFont('Libre Franklin'), gr.themes.GoogleFont('Public Sans'), 'system-ui', 'sans-serif'],
142
- )
143
- with gr.Blocks(css="footer{display:none !important}", theme=theme) as demo:
 
 
144
  gr.Markdown(DESCRIPTION)
145
- gr.DuplicateButton(
146
- value="Duplicate Space for private use",
147
- elem_id="duplicate-button",
148
- visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
149
  )
150
  with gr.Group():
151
- prompt = gr.Text(
152
- label="Prompt",
153
- show_label=False,
154
- max_lines=1,
155
- container=False,
156
- placeholder="Enter your prompt",
157
- )
158
- run_button = gr.Button("Generate")
 
159
  result = gr.Image(label="Result", show_label=False)
160
  with gr.Accordion("Advanced options", open=False):
161
  with gr.Row():
 
15
  DESCRIPTION = """
16
  # OpenDalle 1.1
17
  """
 
 
 
18
  MAX_SEED = np.iinfo(np.int32).max
19
  CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "0") == "1"
20
  MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "1024"))
 
134
  "Realistic image of Thai temple in front of Sunlight, the scene extreme closeup, background in forest"
135
  ]
136
 
137
+ css = '''
138
+ .gradio-container{max-width: 100% !important}
139
+ h1{text-align:center}
140
+ '''
141
+
142
+ with gr.Blocks(css=css) as demo:
143
  gr.Markdown(DESCRIPTION)
144
+ gr.Markdown(
145
+ """
146
+ Made by csit.udru.ac.th for non-commercial license
147
+ """
148
  )
149
  with gr.Group():
150
+ with gr.Row():
151
+ prompt = gr.Text(
152
+ label="Prompt",
153
+ show_label=False,
154
+ max_lines=1,
155
+ container=False,
156
+ placeholder="Describe the image you want",
157
+ )
158
+ run_button = gr.Button("Generate")
159
  result = gr.Image(label="Result", show_label=False)
160
  with gr.Accordion("Advanced options", open=False):
161
  with gr.Row():