HolySmokesGenerator / test_api_call.py
HolySmokes1234's picture
Create test_api_call.py
14919dc verified
raw
history blame contribute delete
678 Bytes
from gradio_client import Client, handle_file
# Connect to your Space
client = Client("HolySmokes1234/HolySmokesGenerator")
# STEP 1 — Generate the preview
preview = client.predict(
img=handle_file("your_photo.png"),
name="Juan",
vibe="Saint of Drama",
color="Divine Gold",
prop="Candles & Incense",
sin="Chaos",
personality="Iconic",
frame_label="Frame 1",
remove_bg_flag=True,
cartoon_flag=False,
api_name="/update_preview",
)
# STEP 2 — Canonize the preview
result = client.predict(
preview_img=preview,
vibe="Saint of Drama",
sin="Chaos",
personality="Iconic",
api_name="/canonize_ai",
)
print(result)