Couple-Product / img2img.py
Zeph27's picture
init
291e480
raw
history blame
607 Bytes
import asyncio
import fal_client
from dotenv import load_dotenv
import os
load_dotenv()
os.environ["FAL_KEY"] = os.getenv("FAL_API_KEY")
async def subscribe():
handler = await fal_client.submit_async(
"comfy/fal-ai/image-to-image",
arguments={
"loadimage_1": "https://fal.media/files/elephant/UX-Etn4FZUSbUqxLKihR1.png",
"prompt": "photograph of cat"
},
)
async for event in handler.iter_events(with_logs=True):
print(event)
result = await handler.get()
print(result)
if __name__ == "__main__":
asyncio.run(subscribe())