Download scripts/test_flux.2_lora.py from YaroslavLinder/ISKA: direct link, hf CLI and curl.
- Browser
- Download file 741 Bytes
-
https://huggingface.co/YaroslavLinder/ISKA/resolve/main/scripts/test_flux.2_lora.py
- Command line
-
hf download hf://YaroslavLinder/ISKA/scripts/test_flux.2_lora.py
-
curl -L -o test_flux.2_lora.py https://huggingface.co/YaroslavLinder/ISKA/resolve/main/scripts/test_flux.2_lora.py
741 Bytes
| import os | |
| import fal_client | |
| import requests | |
| os.environ["FAL_KEY"] = "06ac9dcd-73fe-4799-9d80-9954eba39d84:f28d23d6abb91f26d2d337edc8cb9bf8" | |
| result = fal_client.subscribe( | |
| "fal-ai/flux-2/lora", # <-- Use FLUX.1 endpoint | |
| arguments={ | |
| "prompt": "a photo of ISKA", # <-- Include trigger word | |
| "loras": [ | |
| { | |
| "path": "https://huggingface.co/YaroslavLinder/ISKA/resolve/main/flux.2/iska_flux2_000001500.safetensors", | |
| "scale": 1.0 | |
| } | |
| ], | |
| "guidance_scale": 2.5, | |
| "num_inference_steps": 28 | |
| } | |
| ) | |
| print(result) | |
| output_url=result['images'][0]['url'] | |
| response = requests.get(output_url) | |
| with open("output.png", "wb") as f: | |
| f.write(response.content) | |