Instructions to use limingcv/reward_controlnet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use limingcv/reward_controlnet with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("limingcv/reward_controlnet", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Ming Li commited on
Commit ·
03489e1
1
Parent(s): 84fd721
turn off safty_checker
Browse files
model.py
CHANGED
|
@@ -54,7 +54,7 @@ class Model:
|
|
| 54 |
model_id = CONTROLNET_MODEL_IDS[task_name]
|
| 55 |
controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 56 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
| 57 |
-
base_model_id, controlnet=controlnet, torch_dtype=torch.float16
|
| 58 |
)
|
| 59 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
| 60 |
if self.device.type == "cuda":
|
|
|
|
| 54 |
model_id = CONTROLNET_MODEL_IDS[task_name]
|
| 55 |
controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 56 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
| 57 |
+
base_model_id, safety_checker=None, controlnet=controlnet, torch_dtype=torch.float16
|
| 58 |
)
|
| 59 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
| 60 |
if self.device.type == "cuda":
|