Run this model with HF Jobs
Run m0nix/mylabssd on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/m0nix/mylabssd. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/m0nix/mylabssd on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use m0nix/mylabssd with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use m0nix/mylabssd with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("m0nix/mylabssd", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download sharpness_ally.py from m0nix/mylabssd: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/m0nix/mylabssd/resolve/main/sharpness_ally.py
- Command line
-
hf download hf://m0nix/mylabssd/sharpness_ally.py
-
curl -L -o sharpness_ally.py https://huggingface.co/m0nix/mylabssd/resolve/main/sharpness_ally.py
1.52 kB
| #Developed by Ally - https://www.patreon.com/theally | |
| #https://civitai.com/user/theally | |
| #This node provides a simple interface to adjust the sharpness of the output image prior to saving | |
| import torch | |
| import numpy as np | |
| from PIL import Image, ImageFilter | |
| class SharpnessFilter: | |
| def __init__(self): | |
| pass | |
| def INPUT_TYPES(cls): | |
| return { | |
| "required": { | |
| "image": ("IMAGE",), | |
| "strength": ("FLOAT", {"default": 1.0, "min": -1.0, "max": 6.0, "step": 0.01}), | |
| }, | |
| } | |
| RETURN_TYPES = ("IMAGE",) | |
| FUNCTION = "apply_filter" | |
| CATEGORY = "Image Processing" | |
| def apply_filter(self, image, strength): | |
| # Convert the input image tensor to a PIL Image | |
| i = 255. * image.cpu().numpy().squeeze() | |
| img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8)) | |
| # Apply sharpness adjustment using ImageFilter.UnsharpMask | |
| radius = 1 | |
| percent = int(round(strength * 100)) | |
| threshold = 0 | |
| sharpness_filter = ImageFilter.UnsharpMask(radius=radius, percent=percent, threshold=threshold) | |
| sharpened_image = img.filter(sharpness_filter) | |
| # Convert the sharpened PIL Image back to a tensor | |
| sharpened_image_np = np.array(sharpened_image).astype(np.float32) / 255.0 | |
| sharpened_image_tensor = torch.from_numpy(sharpened_image_np).unsqueeze(0) | |
| return (sharpened_image_tensor, ) | |
| NODE_CLASS_MAPPINGS = { | |
| "Image Sharpening": SharpnessFilter | |
| } | |