vilarin commited on
Commit
f0438e0
·
verified ·
1 Parent(s): f9e608c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import os
2
  import gradio as gr
3
- from io import BytesIO
4
  from PIL import Image
5
  from cloudflare import Cloudflare
6
  #from typing import List, Union
@@ -91,15 +91,13 @@ client = Cloudflare(api_token=API_TOKEN)
91
 
92
  def generate_image(prompt):
93
  try:
94
- image = client.workers.ai.with_raw_response.run(
95
  model_name=IMAGE_MODEL,
96
  account_id=ACCOUNT_ID,
97
  prompt=prompt,
98
  )
99
 
100
- image = Image.open(BytesIO(image.read()))
101
-
102
- image = image.resize((512, 512))
103
 
104
  print(f'image: {image}')
105
 
 
1
  import os
2
  import gradio as gr
3
+ #from io import BytesIO
4
  from PIL import Image
5
  from cloudflare import Cloudflare
6
  #from typing import List, Union
 
91
 
92
  def generate_image(prompt):
93
  try:
94
+ data = client.workers.ai.with_raw_response.run(
95
  model_name=IMAGE_MODEL,
96
  account_id=ACCOUNT_ID,
97
  prompt=prompt,
98
  )
99
 
100
+ image = Image.open(data)
 
 
101
 
102
  print(f'image: {image}')
103