agentsclimarketplace

Fal lora inference

Skill shahshrey/fal-portrait-lora-skills/skills/fal-lora-inference

Generates and evaluates images from a trained portrait LoRA using fal-ai/flux-lora, including LoRA scale sweeps, local image downloads, and review contact sheets. Use when the user asks to run inference, generate, render, sample, or test images from a LoRA; to check likeness or whether a LoRA is overtrained; or mentions flux-lora, lora_scale, safetensors weights, a trigger phrase in a prompt, guidance scale, image_size, or seeds.From its SKILL.md

Install
npx -y skills add shahshrey/fal-portrait-lora-skills --skill fal-lora-inference

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 20 days oldThe repository was created 20 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.0 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

fal LoRA Inference

Generate images from trained LoRA weights with fal-ai/flux-lora, save them locally, and judge whether the LoRA is usable.

Defaults

SettingDefault
Endpointfal-ai/flux-lora
LoRA scale1.0
Image sizeportrait_4_3
Inference steps28
Guidance scale3.5
Images per prompt1
Output formatjpeg
Trigger in promptRequired

Paid-submission rule

Generation is a paid external action.

  • If the current user request explicitly says to generate, render, run inference, sample, or test the LoRA, proceed without asking twice.
  • Otherwise, show the endpoint, prompts, and settings and ask for confirmation.
  • Pass --yes only after one of those conditions is met.

Cost scales with prompts × scales × --num-images. State the total image count before a large sweep.

The trigger phrase is not optional

The trigger phrase carries the identity. A prompt without it renders a generic person even though the LoRA loaded successfully, which reads as a broken LoRA. The script refuses such prompts unless --no-require-trigger is passed.

Workflow

Resolve the project-local skill first:

SKILL_DIR=".cursor/skills/fal-lora-inference"
[ -d "$SKILL_DIR" ] || SKILL_DIR="$HOME/.cursor/skills/fal-lora-inference"
[ -d "$SKILL_DIR" ] || SKILL_DIR="skills/fal-lora-inference"

1. Confirm inputs

Ask if missing:

  • LoRA weights: a fal URL, or a local .safetensors path to upload
  • Trigger phrase used at training time
  • Prompts, or the intent to sweep with defaults
  • Output directory

The trigger phrase and weights URL are recorded in training_result.json and training_request.json if fal-lora-training produced this LoRA. Read them instead of asking.

2. Sweep the LoRA scale

For an untested LoRA, start with one prompt across several scales at a fixed seed so composition stays constant and scale is the only variable:

.venv/bin/python "$SKILL_DIR/scripts/generate_lora_images.py" \
  --lora "./portrait_training_run/subject_lora.safetensors" \
  --trigger-phrase "ohwx man" \
  --prompt "ohwx man, close-up portrait, soft window light, navy blazer" \
  --lora-scale 0.7 0.9 1.1 1.3 \
  --seed 12345 \
  --output-dir "./lora_generations/scale_sweep" \
  --env ".env" \
  --yes

3. Vary the prompts

Once a working scale is known, hold it and test range — shot distance, lighting, wardrobe, setting, expression:

.venv/bin/python "$SKILL_DIR/scripts/generate_lora_images.py" \
  --lora "https://…/pytorch_lora_weights.safetensors" \
  --trigger-phrase "ohwx man" \
  --prompts-file "./prompts.txt" \
  --lora-scale 1.0 \
  --image-size portrait_16_9 \
  --num-images 2 \
  --output-dir "./lora_generations/prompt_set" \
  --env ".env" \
  --yes

--prompts-file takes one prompt per line and ignores blanks and # comments.

The script uploads a local LoRA if needed, runs prompts × scales concurrently, downloads every image, writes generations.json, and renders contact_sheet.jpg.

4. Review the output visually (required)

Open contact_sheet.jpg with image vision, then open individual files at full resolution. Do not report success from exit codes alone — a completed request says nothing about likeness.

Judge likeness, skin texture, eye consistency, prompt adherence, and pose variety against references/evaluation-checklist.md.

5. Deliver

Report:

  • Working LoRA scale, and what failed outside it
  • Whether the LoRA looks under- or overtrained, with the evidence
  • Output directory and contact sheet path
  • Seeds worth reusing
  • Any failed requests

Recommend a retrain only with a specific reason, such as likeness needing 1.3, or training wardrobe persisting across every prompt.

Authentication

Requires fal-client, python-dotenv, and either FAL_KEY or FAL_API_KEY. The script maps FAL_API_KEY to the client-compatible FAL_KEY without printing it. pillow is optional and only powers the contact sheet.

Scripts

ScriptPurpose
scripts/generate_lora_images.pyUpload LoRA, run prompt × scale matrix, download images, write manifest and contact sheet

Degrees of freedom

  • Low: trigger phrase present in every prompt, local downloads, visual review before reporting
  • Medium: prompt wording, image size, steps, guidance, seeds
  • High: which scales to sweep, and whether results justify a retrain

See references/flux-lora-schema.md for the full input and output schema.

What ships with it: 3 files

17.4 KB alongside SKILL.md, 1 of them executable

scripts/

Keep looking

Skills are one crate of 326,645. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.