jbilcke-hf HF staff commited on
Commit
47f7759
1 Parent(s): 18b55b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -52,13 +52,7 @@ def generate(prompt: str,
52
  generator=generator,
53
  output_type='pil').images[0]
54
 
55
- # Convert PIL image to a byte stream
56
- buffered = io.BytesIO()
57
- image.save(buffered, format="PNG")
58
-
59
- # Encode to base64
60
- img_str = base64.b64encode(buffered.getvalue()).decode()
61
- return img_str
62
 
63
  with gr.Blocks() as demo:
64
  gr.HTML("""
@@ -80,7 +74,7 @@ with gr.Blocks() as demo:
80
  placeholder='Enter your prompt',
81
  container=False,
82
  )
83
- result = gr.Text(label='Result', show_label=False, visible=True)
84
  negative_prompt = gr.Text(
85
  label='Negative prompt',
86
  max_lines=1,
 
52
  generator=generator,
53
  output_type='pil').images[0]
54
 
55
+ return image
 
 
 
 
 
 
56
 
57
  with gr.Blocks() as demo:
58
  gr.HTML("""
 
74
  placeholder='Enter your prompt',
75
  container=False,
76
  )
77
+ result = gr.Image(label='Result', show_label=False)
78
  negative_prompt = gr.Text(
79
  label='Negative prompt',
80
  max_lines=1,