Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,10 @@ def generate(prompt, negative_prompt, qr_content, pattern_image, num_inference_s
|
|
| 27 |
'qrcode_background': qrcode_background
|
| 28 |
}
|
| 29 |
if pattern_image is not None:
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
result = illuse.run(
|
| 33 |
model_name,
|
|
@@ -38,6 +41,7 @@ def generate(prompt, negative_prompt, qr_content, pattern_image, num_inference_s
|
|
| 38 |
print(e)
|
| 39 |
st.error(str(e))
|
| 40 |
return
|
|
|
|
| 41 |
|
| 42 |
st.title("Illusion Diffusion Fast Demo powered by replicate")
|
| 43 |
|
|
|
|
| 27 |
'qrcode_background': qrcode_background
|
| 28 |
}
|
| 29 |
if pattern_image is not None:
|
| 30 |
+
image = Image.open(pattern_image)
|
| 31 |
+
image_bytes = BytesIO()
|
| 32 |
+
image.save(image_bytes, format='PNG')
|
| 33 |
+
inputs['image'] = image_bytes
|
| 34 |
|
| 35 |
result = illuse.run(
|
| 36 |
model_name,
|
|
|
|
| 41 |
print(e)
|
| 42 |
st.error(str(e))
|
| 43 |
return
|
| 44 |
+
|
| 45 |
|
| 46 |
st.title("Illusion Diffusion Fast Demo powered by replicate")
|
| 47 |
|