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.
File size: 1,524 Bytes
66376b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#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

    @classmethod
    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
}