Downloads · 30 days
0
AmrDabour/image-colorizer
image-colorizer is a machine learning model from AmrDabour. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for diffusers.
This model colorizes grayscale images using a Stable Diffusion ControlNet approach.
Downloads · 30 days
0
Access
Public
Updated Apr 10, 2025
Parameters
860M
5.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.7 GB · 100%
From the Hugging Face model README
This model colorizes grayscale images using a Stable Diffusion ControlNet approach.
# Install required dependencies
pip install diffusers tensorflow torch
# Load and use the model
from huggingface_hub import hf_hub_download
import tensorflow as tf
from tensorflow import keras
import os
# Define the ColorizeModel class (same as in the original notebook)
# [Insert the ColorizeModel class definition here]
# Download the model files
model_path = hf_hub_download(repo_id="AmrDabour/image-colorizer", filename="image_colorizer.h5")
component_path = os.path.dirname(os.path.dirname(model_path)) + "/models--AmrDabour--image-colorizer/snapshots/COMMIT_HASH"
# Load and use the model
with keras.utils.custom_object_scope({'ColorizeModel': ColorizeModel}):
loaded_model = keras.models.load_model(model_path, compile=False)
result = loaded_model.colorize("your_grayscale_image.jpg", output_path="colored_output.png")
Replace AmrDabour and COMMIT_HASH with appropriate values.