Image-to-Image
Diffusers
pathology
microscopy
image-segmentation
instance-segmentation
lora
qwen-image-edit
Instructions to use Biogod/spatial-banana with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Biogod/spatial-banana 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("Qwen/Qwen-Image-Edit-2511", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Biogod/spatial-banana") 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] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
File size: 4,668 Bytes
038cc91 fe57637 038cc91 fe57637 038cc91 fe57637 038cc91 fe57637 038cc91 fe57637 038cc91 fe57637 038cc91 fe57637 038cc91 fe57637 038cc91 fe57637 038cc91 | 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 | # Released Weights
## Recommended Adapter
The current recommended generalist release is the Mix704 step-8,800 rank-128
task LoRA:
| Field | Value |
| --- | --- |
| Hugging Face repository | `Biogod/spatial-banana` |
| Remote path | `experiments/multimodal/e6_sourcecap32_e125_v1/runs/mix704_step8800/final/pytorch_lora_weights.safetensors` |
| Size | 1,699,695,208 bytes |
| SHA-256 | `cb21fc1044e7f7721f0242b05581fa386e240eb35da4d9a6ef9cd27ddddfe830` |
| Base model | `Qwen/Qwen-Image-Edit-2511` |
| Acceleration LoRA | `lightx2v/Qwen-Image-Edit-2511-Lightning`, four-step BF16 |
| Local expected directory | `runs/patho_banana/multimodal_cell_segmentation/e6_sourcecap32_e125_v1/e6_mix704_sourcecap32_r128_e125_v1.early_stop_recovery_step_008800/resume-state-step-008800/task_lora/` |
The adapter is not a standalone pipeline. It must be loaded after fusing the
four-step Lightning LoRA into the frozen Qwen-Image-Edit-2511 transformer.
## Download
Install the repository environment first:
```bash
uv sync --extra train --extra data --extra dev
```
The commands below pin every remote revision, use HF-Mirror without inheriting
proxy variables, keep Xet enabled, and place files at the paths expected by the
checked-in benchmark configuration.
```bash
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY \
-u http_proxy -u https_proxy -u all_proxy \
HF_ENDPOINT=https://hf-mirror.com \
HF_XET_HIGH_PERFORMANCE=1 \
hf download Qwen/Qwen-Image-Edit-2511 \
--revision 6f3ccc0b56e431dc6a0c2b2039706d7d26f22cb9 \
--local-dir weights/qwen-image-edit-2511/diffusers \
--max-workers "$(nproc)"
mkdir -p weights/loras
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY \
-u http_proxy -u https_proxy -u all_proxy \
HF_ENDPOINT=https://hf-mirror.com \
HF_XET_HIGH_PERFORMANCE=1 \
hf repos cp \
hf://lightx2v/Qwen-Image-Edit-2511-Lightning@d74eba145674fd7e31b949324e148e21e7118abd/Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors \
weights/loras/Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors
release_lora_dir=runs/patho_banana/multimodal_cell_segmentation/e6_sourcecap32_e125_v1/e6_mix704_sourcecap32_r128_e125_v1.early_stop_recovery_step_008800/resume-state-step-008800/task_lora
mkdir -p "$release_lora_dir"
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY \
-u http_proxy -u https_proxy -u all_proxy \
HF_ENDPOINT=https://hf-mirror.com \
HF_XET_HIGH_PERFORMANCE=1 \
hf repos cp \
hf://Biogod/spatial-banana/experiments/multimodal/e6_sourcecap32_e125_v1/runs/mix704_step8800/final/pytorch_lora_weights.safetensors \
"$release_lora_dir/pytorch_lora_weights.safetensors"
```
No Hugging Face token is needed while the repository remains public. If
authentication is required later, expose `HF_TOKEN` only to the process; do not
write it into a config, command-line argument, or committed file.
## Verify
```bash
sha256sum \
weights/loras/Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors \
"$release_lora_dir/pytorch_lora_weights.safetensors"
```
Expected hashes:
```text
22226e8d05d354bb356627d428809f5afd7819399b077238a2b70a82883a904f Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors
cb21fc1044e7f7721f0242b05581fa386e240eb35da4d9a6ef9cd27ddddfe830 pytorch_lora_weights.safetensors
```
Run the repository preflight before inference:
```bash
uv run python scripts/patho_banana/run_cellsam_non_he_benchmark.py \
--config configs/patho_banana/multimodal_cell_segmentation/benchmarks/cellsam_non_he_qwen_current_default_v3.yaml \
audit --allow-missing-data
```
The audit intentionally fails when a weight is absent or has the wrong hash.
`--allow-missing-data` relaxes only the dataset requirement. Full benchmark
reproduction additionally requires the CellSAM datasets and reference model
described by the resolved protocol.
## Evidence and Limitations
- [Model card](model_cards/MIX704_STEP8800_R128.md)
- [Current project results](CURRENT_STATUS.md)
- [822-image result package](../benchmark/pilot/multimodal_cell_segmentation/cellsam_non_he_qwen_mix704_step8800_k3_topology16_v1/RESULTS.md)
- [Completion audit](../benchmark/pilot/multimodal_cell_segmentation/cellsam_non_he_qwen_mix704_step8800_k3_topology16_v1/completion_audit.json)
The development-only prostate grading adapter is archived separately at
`experiments/biological_applications/pb_e06_prostate_grading_p01_v1/runs/mix704_r128/final/`.
It is not the recommended generalist segmentation adapter and is not intended
for clinical use.
The remaining adapters in `Biogod/spatial-banana` are retained as development
or recovery artifacts. Their presence does not mean that they passed the final
scientific gate.
|