Before You Start
You’ll need:- Python - we recommend 3.11
- A fal account (sign up is free)
- Basic familiarity with Python and AI models
Step 1: Install the CLI
If you haven’t already:Step 2: Authenticate
Get your API key from the fal dashboard and authenticate:Step 3: Create Your Image Generator
Create a file calledimage_generator.py with this Stable Diffusion XL text-to-image model:
Step 4: Test Your Image Generator
Run your model to test it:Application startup complete, test it with curl using the URL from the output:
Step 5: Deploy Your Model
Once you are satisfied with the results, deploy your app to create a persistent URL. Deployed apps scale automatically, with runners managed by fal’s infrastructure. You can configure scaling behavior through parameters likekeep_alive, min_concurrency, and max_concurrency. See Scale Your Application to learn more.
Step 6: Call Your Deployed App
Once deployed, call your image generator from any Python or JavaScript application using the fal client SDK.- Python
- JavaScript
your-username/my-demo-app with the endpoint ID shown after deploying. See Calling Your Endpoints for all calling patterns including async queue, streaming, real-time, and webhooks.