feat: media expansion surfaces — edit mask, upscale, background removal, interpolation, diarization, meshgen (ADR-0020)
- imagegen.EditRequest.Mask -> sd-server img2img inpainting (white=repaint) - imagegen.Upscaler + BackgroundRemover, videogen.Interpolator, audio.DiarizationModel: new optional provider-minted surfaces - NEW meshgen leaf package (image->3D, glb/stl/obj) - provider/llamaswap: all five via the /upstream/<model>/<path> passthrough (upstreamPath helper, shared one-file multipart builder); binary success bodies validated (non-image, non-video, JSON-mesh rejection); diarization pins output=json (vtt/srt drop speaker labels) Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
@@ -128,6 +128,11 @@ type img2imgRequest struct {
|
||||
txt2imgRequest
|
||||
InitImages []string `json:"init_images"`
|
||||
DenoisingStrength *float64 `json:"denoising_strength,omitempty"`
|
||||
// Mask enables inpainting: base64 image, white = repaint, black = keep
|
||||
// (sd-server also accepts a data URL; plain base64 keeps symmetry with
|
||||
// init_images). sd-server has no mask_blur/inpaint_full_res — callers
|
||||
// wanting soft edges pre-feather the mask.
|
||||
Mask string `json:"mask,omitempty"`
|
||||
}
|
||||
|
||||
// Edit implements imagegen.Editor via POST {base}/sdapi/v1/img2img.
|
||||
@@ -148,6 +153,9 @@ func (m *imageModel) Edit(ctx context.Context, req imagegen.EditRequest, opts ..
|
||||
InitImages: []string{base64.StdEncoding.EncodeToString(req.Init.Data)},
|
||||
DenoisingStrength: req.Strength,
|
||||
}
|
||||
if len(req.Mask.Data) > 0 {
|
||||
wire.Mask = base64.StdEncoding.EncodeToString(req.Mask.Data)
|
||||
}
|
||||
|
||||
var resp txt2imgResponse
|
||||
if err := m.p.doJSON(ctx, http.MethodPost, "/sdapi/v1/img2img", m.id, &wire, &resp); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user