Spaces:
Sleeping
Sleeping
File size: 1,648 Bytes
77a8f32 0b6959e 77a8f32 438537f 0b6959e b4981f9 438537f e5ec07f 0b6959e 438537f 0b6959e 438537f 0b6959e 438537f 0b6959e 438537f 0b6959e 438537f 0b6959e b4981f9 438537f 0b6959e 77a8f32 c44a54d e5ec07f 438537f e5ec07f 438537f c44a54d 438537f 0b6959e 438537f 77a8f32 0b6959e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | import gradio as gr
from huggingface_hub import InferenceClient
# Connecting to the ultra-fast FLUX image cluster
client = InferenceClient()
def generate_studio_art(prompt):
if not prompt:
return None
print(f"RustyAI Engine is rendering art for: {prompt}")
try:
# Call the server to instantly bake a high-fidelity image file
image = client.text_to_image(
prompt=prompt,
model="black-forest-labs/FLUX.1-schnell"
)
# Save the crisp image file to display
output_filename = "rusty_studio_art.png"
image.save(output_filename)
return output_filename
except Exception as e:
print(f"Studio Error: {e}")
return None
# Custom UI layout for your RustyAI Image Studio
with gr.Blocks(title="RustyAI Image Studio") as demo:
gr.Markdown("# 🎨 RustyAI Image Studio")
gr.Markdown("Type an idea, hit generate, and watch the FLUX engine bake high-speed concept art!")
with gr.Row():
with gr.Column():
user_prompt = gr.Textbox(
label="Describe your artwork or character design",
placeholder="e.g., A terrifying analog horror entity with glowing eyes standing in a dark basement, VHS tape overlay, highly detailed 3D render..."
)
run_btn = gr.Button("Generate Art ✨", variant="primary")
with gr.Column():
image_output = gr.Image(label="Rendered Result")
run_btn.click(fn=generate_studio_art, inputs=user_prompt, outputs=image_output)
if __name__ == "__main__":
demo.launch() |