-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
Hello,
I am currently trying to use the Color Matching in golang. Here is my code:
...
req := generation.Request{
EngineId: "stable-diffusion-xl-1024-v1-0",
RequestedType: generation.ArtifactType_ARTIFACT_IMAGE,
Params: &generation.Request_Transform{
Transform: &generation.TransformParameters{
Transform: &generation.TransformParameters_ColorAdjust{
ColorAdjust: &generation.TransformColorAdjust{
MatchImage: &color_swatch,
MatchMode: generation.ColorMatchMode_COLOR_MATCH_RGB.Enum(),
},
},
},
},
Prompt: []*generation.Prompt{
{
Prompt: &generation.Prompt_Artifact{Artifact: artifact},
},
},
}
generate(createGrpcCtx(context.Background(), token), client, &req)
where generate
uses the code verbatim as in #49 and artifact
is the returned Artifact from a previous text-based prompt. The color_swatch
artifact is created with this snippet:
file, _ := os.Open("./colors.png")
defer file.Close()
stat, _ := file.Stat()
buf := make([]byte, stat.Size())
_, _ = bufio.NewReader(file).Read(buf)
color_swatch := generation.Artifact{
Type: generation.ArtifactType_ARTIFACT_IMAGE,
Mime: "image/png",
Magic: Ptr[string]("PNG"),
Data: &generation.Artifact_Binary{
Binary: buf,
},
Size: uint64(stat.Size()),
}
Whenever I run this code, I get the error Error after 1.063 s: rpc error: code = InvalidArgument desc = must provide image parameters
. From my understanding, this implies that I should have ImageParameters
as part of Params
in the request, though the request itself can only have a single Param. I'm a bit at a loss as to how this should work.
My desired outcome is to simply color match a second image.
Metadata
Metadata
Assignees
Labels
No labels