Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support URL in clone mode: Error: Invalid mode for clone() #6

Open
srelbo opened this issue Sep 27, 2024 · 1 comment
Open

Comments

@srelbo
Copy link

srelbo commented Sep 27, 2024

Looks like url support in clone mode is in the works, but its not implemented yet.

type CloneOptions = {
    mode: "url";
    link: string;
    enhance?: boolean;
} | {
    mode: "clip";
    clip: Blob;
    enhance?: boolean;
};

But:

	async clone(options: CloneOptions): Promise<CloneResponse> {
		if (options.mode === "clip") {
			const formData = new FormData();
			formData.append("clip", options.clip);
			if (options.enhance !== undefined) {
				formData.append("enhance", options.enhance.toString());
			}

			const response = await this._fetch("/voices/clone/clip", {
				method: "POST",
				body: formData,
			});
			return response.json();
		}

		throw new Error("Invalid mode for clone()");
	}
@kbrgl
Copy link
Member

kbrgl commented Oct 7, 2024

Thanks for the callout. This was something we used to support but removed due to the high potential for abuse. We will remove this type in a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants