MCPcopy Create free account
hub / github.com/AiuniAI/Unique3D / process_image

Function process_image

app/custom_models/utils.py:28–42  ·  view source on GitHub ↗
(function, img, guidance_scale=2., merged_image=False, remove_bg=True)

Source from the content-addressed store, hash-verified

26
27from app.utils import make_image_grid, split_image
28def process_image(function, img, guidance_scale=2., merged_image=False, remove_bg=True):
29 from rembg import remove
30 if remove_bg:
31 img = remove(img)
32 img = rgba_to_rgb(img)
33 if merged_image:
34 img = split_image(img, rows=2)
35 images = function(
36 image=img,
37 guidance_scale=guidance_scale,
38 )
39 if len(images) > 1:
40 return make_image_grid(images, rows=2)
41 else:
42 return images[0]
43
44
45def process_text(trainer, pipeline, img, guidance_scale=2.):

Callers

nothing calls this directly

Calls 3

rgba_to_rgbFunction · 0.90
split_imageFunction · 0.90
make_image_gridFunction · 0.90

Tested by

no test coverage detected