File size: 3,705 Bytes
b5b9c2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# Running Apps

## Basic Run

```bash
infsh app run user/app-name --input input.json
```

## Inline JSON

```bash
infsh app run falai/flux-dev-lora --input '{"prompt": "a sunset over mountains"}'
```

## Version Pinning

```bash
infsh app run user/app-name@1.0.0 --input input.json
```

## Local File Uploads

The CLI automatically uploads local files when you provide a file path instead of a URL. Any field that accepts a URL also accepts a local path:

```bash
# Upscale a local image
infsh app run falai/topaz-image-upscaler --input '{"image": "/path/to/photo.jpg", "upscale_factor": 2}'

# Image-to-video from local file
infsh app run falai/wan-2-5-i2v --input '{"image": "./my-image.png", "prompt": "make it move"}'

# Avatar with local audio and image
infsh app run bytedance/omnihuman-1-5 --input '{"audio": "/path/to/speech.mp3", "image": "/path/to/face.jpg"}'

# Post tweet with local media
infsh app run x/post-create --input '{"text": "Check this out!", "media": "./screenshot.png"}'
```

Supported paths:
- Absolute paths: `/home/user/images/photo.jpg`
- Relative paths: `./image.png`, `../data/video.mp4`
- Home directory: `~/Pictures/photo.jpg`

## Generate Sample Input

Before running, generate a sample input file:

```bash
infsh app sample falai/flux-dev-lora
```

Save to file:

```bash
infsh app sample falai/flux-dev-lora --save input.json
```

Then edit `input.json` and run:

```bash
infsh app run falai/flux-dev-lora --input input.json
```

## Workflow Example

### Image Generation with FLUX

```bash
# 1. Get app details
infsh app get falai/flux-dev-lora

# 2. Generate sample input
infsh app sample falai/flux-dev-lora --save input.json

# 3. Edit input.json
# {
#   "prompt": "a cat astronaut floating in space",
#   "num_images": 1,
#   "image_size": "landscape_16_9"
# }

# 4. Run
infsh app run falai/flux-dev-lora --input input.json
```

### Video Generation with Veo

```bash
# 1. Generate sample
infsh app sample google/veo-3-1-fast --save input.json

# 2. Edit prompt
# {
#   "prompt": "A drone shot flying over a forest at sunset"
# }

# 3. Run
infsh app run google/veo-3-1-fast --input input.json
```

### Text-to-Speech

```bash
# Quick inline run
infsh app run falai/kokoro-tts --input '{"text": "Hello, this is a test."}'
```

## Task Tracking

When you run an app, the CLI shows the task ID:

```
Running falai/flux-dev-lora
Task ID: abc123def456
```

For long-running tasks, you can check status anytime:

```bash
# Check task status
infsh task get abc123def456

# Get result as JSON
infsh task get abc123def456 --json

# Save result to file
infsh task get abc123def456 --save result.json
```

### Run Without Waiting

For very long tasks, run in background:

```bash
# Submit and return immediately
infsh app run google/veo-3 --input input.json --no-wait

# Check later
infsh task get <task-id>
```

## Output

The CLI returns the app output directly. For file outputs (images, videos, audio), you'll receive URLs to download.

Example output:

```json
{
  "images": [
    {
      "url": "https://cloud.inference.sh/...",
      "content_type": "image/png"
    }
  ]
}
```

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| "invalid input" | Schema mismatch | Check `infsh app get` for required fields |
| "app not found" | Wrong app name | Check `infsh app list --search` |
| "quota exceeded" | Out of credits | Check account balance |

## Documentation

- [Running Apps](https://inference.sh/docs/apps/running) - Complete running apps guide
- [Streaming Results](https://inference.sh/docs/api/sdk/streaming) - Real-time progress updates
- [Setup Parameters](https://inference.sh/docs/apps/setup-parameters) - Configuring app inputs