Instructions to use Baragi-AI/LPC-FourDirection-Walk-Flux-Klein-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Baragi-AI/LPC-FourDirection-Walk-Flux-Klein-9B with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-base-9B", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Baragi-AI/LPC-FourDirection-Walk-Flux-Klein-9B") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
| param( | |
| [string]$Owner = "Baragi-AI", | |
| [string]$Repository = "LPC-FourDirection-Walk-Flux-Klein-9B", | |
| [ValidateSet("public", "private")] | |
| [string]$Visibility = "public" | |
| ) | |
| $ErrorActionPreference = "Stop" | |
| $slug = "$Owner/$Repository" | |
| Set-Location -LiteralPath $PSScriptRoot | |
| $repoPath = (Resolve-Path -LiteralPath $PSScriptRoot).Path.Replace("\", "/") | |
| $safeDirectories = @(git config --global --get-all safe.directory 2>$null) | |
| if ($safeDirectories -notcontains $repoPath) { | |
| git config --global --add safe.directory $repoPath | |
| if ($LASTEXITCODE -ne 0) { throw "Could not register the repository as a safe directory." } | |
| } | |
| gh auth status 2>$null | |
| if ($LASTEXITCODE -ne 0) { | |
| gh auth login -h github.com -p https -w | |
| if ($LASTEXITCODE -ne 0) { throw "GitHub authentication failed." } | |
| } | |
| $insideRepo = git rev-parse --is-inside-work-tree 2>$null | |
| if ($LASTEXITCODE -ne 0 -or $insideRepo -ne "true") { | |
| throw "Run this script from the release repository directory." | |
| } | |
| if (git status --porcelain) { | |
| throw "The working tree is not clean. Commit the changes before publishing." | |
| } | |
| $branch = git branch --show-current | |
| if ($branch -ne "main") { | |
| throw "Expected branch 'main', found '$branch'." | |
| } | |
| gh repo view $slug --json nameWithOwner 2>$null | Out-Null | |
| if ($LASTEXITCODE -ne 0) { | |
| gh repo create $slug "--$Visibility" --source . --remote origin --push ` | |
| --description "FLUX.2 Klein 9B LoRA for female LPC four-direction walking sprites" | |
| if ($LASTEXITCODE -ne 0) { throw "Repository creation or initial push failed." } | |
| } | |
| else { | |
| $remote = git remote get-url origin 2>$null | |
| if ($LASTEXITCODE -eq 0) { | |
| git remote set-url origin "https://github.com/$slug.git" | |
| } | |
| else { | |
| git remote add origin "https://github.com/$slug.git" | |
| } | |
| git push -u origin main | |
| if ($LASTEXITCODE -ne 0) { throw "Push failed." } | |
| } | |
| gh repo view $slug --web | |
| Write-Host "Published: https://github.com/$slug" | |