Skip to content
ModelListedExternal
Download

SD14 Pathology ControlNet

These are controlnet weights trained on CompVis/stable-diffusion-v1-4 with new type of conditioning. You can find some example images below.

KindControlNetBase modelCompVis/stable-diffusion-v1-4VersionBgrade

Model source

Kind
ControlNet
File size
1.35 GB
Base model
CompVis/stable-diffusion-v1-4
Version
vdiffusion_pytorch_model
Updated
Oct 7, 2026
Downloads
10
Source
Hugging Face

Source description

controlnet-RiddleHe/SD14_pathology_controlnet

These are controlnet weights trained on CompVis/stable-diffusion-v1-4 with new type of conditioning. You can find some example images below.

prompt: A histopathology image of breast cancer tissue. images_0) prompt: An image of breast cancer histopathology with detailed cellular structures. images_1)

Intended uses & limitations

How to use

controlnet = ControlNetModel.from_pretrained("RiddleHe/SD14_pathology_controlnet", torch_dtype=torch.float16)
pipe = StableDiffusionControlNetPipeline.from_pretrained(
    "RiddleHe/SD14_pathology_base", controlnet=controlnet, torch_dtype=torch.float16
)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
pipe.to('cuda')

prompt = "A histopathology image of breast cancer tissue."
mask = mask.convert("RGB")  # Provide a mask

generator = torch.Generator(device='cuda').manual_seed(42)

with torch.no_grad():
  out = pipe(prompt, image=mask, num_inference_steps=70, num_images_per_prompt=3, generator=generator).images

Limitations and bias

[TODO: provide examples of latent issues and potential remediations]

Training details

The model is trained on 28216 image-mask pairs from the BRCA breast cancer dataset. Input is mask and output is image.

Mask is a single channel image with integer values from 0 to 21 representing 22 classes, eg. 1 representing tumor, 2 representing stroma.

Sources

1 source
Hugging FacePrimaryVersion d0267aaee54c2e8f5a1f640229ccfbf8acb3d720
huggingface.co/RiddleHe/SD14_pathology_controlnet/tree/d0267aaee54c2e8f5a1f640229ccfbf8acb3d720

Verified Oct 7

Model artifacts

1 artifact

checkpoint-18000/controlnet/diffusion_pytorch_model.safetensors

safetensors · 1.35 GB · SHA-256 08ba56fdb2e1…5e17 · Hugging Face

Download file

Source excerpts

3 excerpts

--- base_model: - CompVis/stable-diffusion-v1-4 - RiddleHe/SD14_pathology_lora library_name: diffusers license: creativeml-openrail-m inference: true tags: - stable-diffusion - stable-diffusion-diffusers - text-to-image - diffusers - controlnet - diffusers-training --- <!-- This model card has been generated automatically according to the information the training script had access to. You should probably proofread and complete it, then remove this comment. --> # controlnet-RiddleHe/SD14_pathology_controlnet These are controlnet weights trained on CompVis/stable-diffusion-v1-4 with new type of conditioning. You can find some example images below. prompt: A histopathology image of breast cancer tissue. ![images_0)](./imgs/controlnet_validation_1.png) prompt: An image of breast cancer histopathology with detailed cellular structures. ![images_1)](./imgs/controlnet_validation_2.png) ## Intended uses & limitations #### How to use ```python controlnet = ControlNetModel.from_pretrained("RiddleHe/SD14_pathology_controlnet", torch_dtype=torch.float16) pipe = StableDiffusionControlNetPipeline.from_pretrained( "RiddleHe/SD14_pathology_base", controlnet=controlnet, torch_dtype=torch.float16 ) pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config) pipe.to('cuda') prompt = "A histopathology image of breast cancer tissue." mask = mask.convert("RGB") # Provide a mask generator = torch.Generator(device='cuda').manual_seed(42) with torch.no_grad(): out = pipe(prompt, image=mask, num_inference_steps=70, num_images_per_prompt=3, generator=generator).images ``` #### Limitations and bias [TODO: provide examples of latent issues and potential remediations] ## Training details The model is trained on 28216 image-mask pairs from the BRCA breast cancer dataset. Input is mask and output is image. Mask is a single channel image with integer values from 0 to 21 representing 22 classes, eg. 1 representing tumor, 2 representing stroma.

Source context: 10 downloads · 1 likes · Pipeline text-to-image · Library diffusers · Repo RiddleHe/SD14_pathology_controlnet

Source context: 2 downloads · 1 likes · Pipeline text-to-image · Library diffusers · Repo RiddleHe/SD14_pathology_controlnet