Spaces:
Sleeping
Sleeping
| import os | |
| import io | |
| import modal | |
| import gradio as gr | |
| from PIL import Image | |
| from daggr import FnNode, Graph | |
| def convert_image_to_bytes(image) -> bytes: | |
| return b"test" | |
| try: | |
| print("Attempting to create FnNode...") | |
| converter = FnNode( | |
| fn=convert_image_to_bytes, | |
| name="Image Converter", | |
| inputs={ | |
| "image": gr.Image(label="Upload your photo"), | |
| }, | |
| outputs={ | |
| "output": gr.Textbox(visible=False), | |
| }, | |
| ) | |
| print("Success!") | |
| print(f"Output port: {converter.output}") | |
| except Exception as e: | |
| import traceback | |
| traceback.print_exc() | |