File size: 2,712 Bytes
7f635f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
Generate an image or video with an open model on the user's rented GPU box, optionally with up to 4 LoRAs (strength 0 to 2). Reuses the user's live box running model_id, else rents a new one on gpu_type: a box bills credits by the second from when it is ready until the user stops it or credits run out. Call only after the user explicitly approved the box's hourly price (gpu_list_gpus); pass it as max_credits_per_hour. Nothing is rented above it. While the box starts or loads the model nothing is generated: call again with the same arguments after retry_after_s. When queued, wait for the jobs with jobs_wait. If the GPU limit is reached nothing is rented: wait and call again.

```ts
mcp__Higgsfield__gpu_generate(args: {
// gpu_type from the model's gpu_types; needed only when no live box of the user already runs model_id.
gpu_type?: string, // minLength: 1, maxLength: 64
// A new unique string (e.g. a UUID) per generation. Reuse it unchanged on every repeat call for the same generation.
idempotency_key: string, // minLength: 1, maxLength: 200
// Up to 4 LoRAs, each made for model_id.
// default: [], maxItems: 4
loras?: Array<
{
// lora_id from gpu_list_loras or gpu_lora_import.
lora_id: string, // minLength: 1, maxLength: 100
// 0 to 2; omit for the LoRA's default.
strength?: number, // minimum: 0.0, maximum: 2.0
}
>,
// The hourly price the user explicitly approved for renting the box: credits_per_gpu_hour from gpu_list_gpus times the GPU count.
max_credits_per_hour: number, // minimum: 0.0
// Reference images or videos, up to the model's inputs limit from gpu_list_models.
// default: [], maxItems: 12
medias?: Array<
{
data: {
// Uploaded media id.
id: string, // pattern: /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, format: "uuid"
// media_input for an image, video_input for a video.
type: string, // minLength: 1, maxLength: 64
},
role: "image" | "video",
}
>,
// model_id from gpu_list_models.
model_id: string, // minLength: 1, maxLength: 80
prompt: string, // minLength: 1, maxLength: 10000
// A live box from gpu_my to run on; omit to reuse or rent one.
session_id?: string, // pattern: /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, format: "uuid"
}): Promise<{ credits_per_hour: number, gpu_type: string, jobs: { job_id: string, status: string | null, url: string | null, [key: string]: any }[], next_step: string, retry_after_s?: number, session_id: string, state: "queued" | "starting" | "loading", [key: string]: any }>;
```