|
|
@@ -0,0 +1,735 @@
|
|
|
+/**
|
|
|
+ * 测试获取数据接口
|
|
|
+ * @param {*} workId
|
|
|
+ * @param {*} routerName
|
|
|
+ */
|
|
|
+async function testgetDataByTask(workId, routerName) {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getDataByTask02'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ workId,
|
|
|
+ routerName,
|
|
|
+ // logo_info: {
|
|
|
+ // "add_logo": true, // 是否添加水印
|
|
|
+ // "position": 1, // 水印位置(0-3)
|
|
|
+ // "language": 0, // 水印语言(0中文/1英文)
|
|
|
+ // "opacity": 0.5, // 不透明度(0-1)
|
|
|
+ // "logo_text_content": '非常好看的水印' // 自定义水印文本
|
|
|
+ // },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// testgetImgV4()
|
|
|
+// testgetDataByTask('u1XrdyaG2f', 'getClothesV2')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**测试图片生成v4接口 */
|
|
|
+async function testgetImgV4() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getImgV4'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ image_urls: [
|
|
|
+ // 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250829/050458620.jpg',//模特
|
|
|
+ // 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20251010/110201038.png',//衣服
|
|
|
+ // 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250718/042053608.jpg',//裤子
|
|
|
+ // 'https://img95.699pic.com/photo/60070/7188.jpg_wh860.jpg',//鞋子
|
|
|
+ // 'https://img95.699pic.com/photo/60046/9255.jpg_wh860.jpg',//刺绣
|
|
|
+ ],
|
|
|
+ prompt: '帮我生成一个涵盖友情、独特、文化底蕴、科技的可爱日漫风但人物为中国人的图片',
|
|
|
+ sizeDate: {
|
|
|
+ width: 2048,
|
|
|
+ height: 2048,
|
|
|
+ },
|
|
|
+ scale: 0.6,
|
|
|
+ force_single: false,
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// testgetText2ImgV3()
|
|
|
+// testgetDataByTask('fCF1wWWAvd', 'getText2ImgV3')
|
|
|
+/**测试文生图v3.0接口 */
|
|
|
+async function testgetText2ImgV3() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getText2ImgV3'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ prompt: '芙蓉面美如远山秀,杏仁眼灵性儿透。',
|
|
|
+ use_pre_llm: true,
|
|
|
+ sizeDate: {
|
|
|
+ width: 599,
|
|
|
+ height: 1328,
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// testgetText2ImgV31()
|
|
|
+// testgetDataByTask('F7Jg20O8kT', 'getText2ImgV31')
|
|
|
+/**测试文生图v3.1接口 */
|
|
|
+async function testgetText2ImgV31() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getText2ImgV31'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ prompt: '淡蓝紫的冷清感,一束小雏菊,右下角展示一串小的艺术字”手捧一束小雏菊赠与你,那是藏于内心的光芒。“',
|
|
|
+ use_pre_llm: true,
|
|
|
+ sizeDate: {
|
|
|
+ width: 599,
|
|
|
+ height: 1328,
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// testgetImg2ImgV3()
|
|
|
+// testgetDataByTask('o4BVp8Jkis', 'getImg2ImgV3')
|
|
|
+/**测试图生图v3.0接口 */
|
|
|
+async function testgetImg2ImgV3() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getImg2ImgV3'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ image_url: 'https://portal.volccdn.com/obj/volcfe/cloud-universal-doc/upload_cb41187994a982411145b758a9bf3241.png',
|
|
|
+ prompt: '背景换成秋天落叶',
|
|
|
+ scale: 0.5,
|
|
|
+ sizeDate: {
|
|
|
+ width: 1328,
|
|
|
+ height: 1328,
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// testgetVideoV3_Pro()
|
|
|
+// testgetDataByTask('UHY260ah4C', 'getVideoV3_Pro')
|
|
|
+async function testgetVideoV3_Pro() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getVideoV3_Pro'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ prompt: '两个q版小女孩笑着面向镜头慢慢地跑',
|
|
|
+ frames: 121,
|
|
|
+ image_url: 'https://portal.volccdn.com/obj/volcfe/cloud-universal-doc/upload_cb41187994a982411145b758a9bf3241.png',
|
|
|
+ aspect_ratio: 5,
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// testgetImgV4_pod()
|
|
|
+// testgetDataByTask('hzTkHHsCjo', 'getImgV4_pod')
|
|
|
+/**测试图片生成4.0-素材提取(POD按需定制)接口 */
|
|
|
+async function testgetImgV4_pod() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getImgV4_pod'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ image_url:'https://img95.699pic.com/photo/60046/9255.jpg_wh860.jpg',//刺绣
|
|
|
+ instruction: 1,
|
|
|
+ prompt: '改成淡紫色的花朵,深绿色的枝叶',
|
|
|
+ sizeDate: {
|
|
|
+ width: 2048,
|
|
|
+ height: 2048,
|
|
|
+ },
|
|
|
+ lora_weight:0.5,
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// testgetImgV4_goods()
|
|
|
+// testgetDataByTask('LwoFZ892Ut', 'getImgV4_goods')
|
|
|
+/**测试图片生成4.0-素材提取(POD按需定制)接口 */
|
|
|
+async function testgetImgV4_goods() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getImgV4_goods'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ image_url:'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20260312/040725626.jpg',//模特
|
|
|
+ instruction: 1,
|
|
|
+ sizeDate: {
|
|
|
+ width: 2560,
|
|
|
+ height: 1440,
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// testgetInpaint()
|
|
|
+// testgetDataByTask('gsMphbw7Gd', 'getInpaint')
|
|
|
+/**测试交互编辑接口 */
|
|
|
+async function testgetInpaint() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getInpaint'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ image_urls: [
|
|
|
+ 'https://portal.volccdn.com/obj/volcfe/cloud-universal-doc/upload_cb41187994a982411145b758a9bf3241.png',
|
|
|
+ 'https://portal.volccdn.com/obj/volcfe/cloud-universal-doc/upload_f8f192dc0a831c6ccc3a342fb43d0c97.png'
|
|
|
+ ],
|
|
|
+ prompt: '将小女孩换成《白蛇传》里面的人形青白蛇姐妹',
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// testgetSuperResolution()
|
|
|
+// testgetDataByTask('EdXi31Dvro', 'getSuperResolution')
|
|
|
+/**测试智能超清接口 */
|
|
|
+async function testgetSuperResolution() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getSuperResolution'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ image_urls: [
|
|
|
+ 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250829/050458620.jpg'
|
|
|
+ ],
|
|
|
+ resolution: '4k',
|
|
|
+ scale: 100,
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// 测试换装v2接口
|
|
|
+function testgetClothesV2() {
|
|
|
+ const body = {
|
|
|
+ model: 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250723/023647101.jpg', // 模特图URL
|
|
|
+ upper: 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250723/054650783.png', // 上装图URL
|
|
|
+ bottom: 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250718/042053608.jpg', // 下装图URL
|
|
|
+ inference_config: {
|
|
|
+ do_sr: false,
|
|
|
+ seed: -1,
|
|
|
+ keep_head: true,
|
|
|
+ keep_hand: false,
|
|
|
+ keep_foot: false,
|
|
|
+ num_steps: 16,
|
|
|
+ keep_upper: false,
|
|
|
+ keep_lower: false,
|
|
|
+ tight_mask: "loose",
|
|
|
+ p_bbox_iou_ratio: 0.3,
|
|
|
+ p_bbox_expand_ratio: 1.1,
|
|
|
+ max_process_side_length: 1920
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ };
|
|
|
+
|
|
|
+ fetch('https://server.fmode.cn/api/volcengine/jimeng/getClothesV2', {
|
|
|
+ method: 'POST',
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
+ },
|
|
|
+ body: JSON.stringify(body)
|
|
|
+ })
|
|
|
+ .then(response => response.json())
|
|
|
+ .then(data => {
|
|
|
+ console.log('换装v2接口响应:', data);
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error('换装v2接口错误:', error);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// testgetClothesV2()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+//测试视频生成v3 720p接口
|
|
|
+async function testgetVideoV3_720p_method1() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getVideoV3_720p'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ prompt: '一只小猫在草地上奔跑',
|
|
|
+ frames: 121,
|
|
|
+ method: '1',
|
|
|
+ config: {
|
|
|
+ aspect_ratio: '16:9',
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', JSON.stringify(data))
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+// testgetDataByTask('CFiUzNn6Yv', 'getClothesV2')
|
|
|
+
|
|
|
+// testgetVideoV3_720p_method1()
|
|
|
+// testgetVideoV3_720p_method2()
|
|
|
+// testgetVideoV3_720p_method3()
|
|
|
+// testgetVideoV3_720p_method4()
|
|
|
+async function testgetVideoV3_720p_method2() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getVideoV3_720p'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ prompt: '根据首帧延展生成视频',
|
|
|
+ frames: 121,
|
|
|
+ method: '2',
|
|
|
+ config: {
|
|
|
+ image_urls: ['https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250829/050458620.jpg'],
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+async function testgetVideoV3_720p_method3() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getVideoV3_720p'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ prompt: '根据首尾帧生成视频',
|
|
|
+ frames: 121,
|
|
|
+ method: '3',
|
|
|
+ config: {
|
|
|
+ image_urls: [
|
|
|
+ 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250829/050458620.jpg',
|
|
|
+ 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20251010/110201038.png'
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', JSON.stringify(data))
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+async function testgetVideoV3_720p_method4() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getVideoV3_720p'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ prompt: '根据首帧生成运镜视频',
|
|
|
+ frames: 121,
|
|
|
+ method: '4',
|
|
|
+ config: {
|
|
|
+ image_urls: ['https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250829/050458620.jpg'],
|
|
|
+ template_id: 'quick_pull_back',
|
|
|
+ camera_strength: 'medium',
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', JSON.stringify(data))
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// testgetDataByTask('3ZLpNkBudx', 'getVideoV3_1080p')
|
|
|
+// testgetVideoV3_1080p_method1()
|
|
|
+// testgetVideoV3_1080p_method2()
|
|
|
+// testgetVideoV3_1080p_method3()
|
|
|
+async function testgetVideoV3_1080p_method1() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getVideoV3_1080p'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ prompt: '表达友情、信任、尊重、合作,一种二次元+可爱风格',
|
|
|
+ frames: 121,
|
|
|
+ method: '1',
|
|
|
+ config: {
|
|
|
+ aspect_ratio: '16:9'
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', JSON.stringify(data))
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+// testgetVideoV3_1080p_method2()
|
|
|
+testgetDataByTask('W30Axg9ujJ', 'getVideoV3_1080p')
|
|
|
+
|
|
|
+async function testgetVideoV3_1080p_method2() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getVideoV3_1080p'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ prompt: '根据首帧延展生成视频',
|
|
|
+ frames: 121,
|
|
|
+ method: '2',
|
|
|
+ config: {
|
|
|
+ image_urls: ['https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250829/050458620.jpg']
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', JSON.stringify(data))
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+async function testgetVideoV3_1080p_method3() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getVideoV3_1080p'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ prompt: '根据首尾帧生成视频',
|
|
|
+ frames: 121,
|
|
|
+ method: '3',
|
|
|
+ config: {
|
|
|
+ image_urls: [
|
|
|
+ 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250829/050458620.jpg',
|
|
|
+ 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20251010/110201038.png'
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', JSON.stringify(data))
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// testgetDataByTask('mC56nNhM4o', 'getActor')
|
|
|
+// testgetActor()
|
|
|
+
|
|
|
+/**测试动作模仿接口 */
|
|
|
+async function testgetActor() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getActor'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ "headers": {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ "method": 'POST',
|
|
|
+ "mode": "cors",
|
|
|
+ "referrer": "http://localhost:4200/",
|
|
|
+ body: JSON.stringify({
|
|
|
+ video_url: 'https://file-cloud.fmode.cn/storage/company/UEoqWqwz8f/20251121/023425380.mp4',
|
|
|
+ image_url: 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250829/050458620.jpg',
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// testgetActorV2()
|
|
|
+// testgetDataByTask('6QMQVuYMYN', 'getActorV2')
|
|
|
+/**测试动作模仿v2.0 */
|
|
|
+async function testgetActorV2() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getActorV2'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ headers: { 'Content-Type': 'application/json' },
|
|
|
+ method: 'POST',
|
|
|
+ mode: 'cors',
|
|
|
+ referrer: 'http://localhost:4200/',
|
|
|
+ body: JSON.stringify({
|
|
|
+ image_url: 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250829/050458620.jpg',
|
|
|
+ video_url: 'https://file-cloud.fmode.cn/storage/company/UEoqWqwz8f/20251121/023425380.mp4',
|
|
|
+ cut_result_first_second_switch: false,
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// testGetOhIdentifyMain()//qH58sm1wMr
|
|
|
+// testGetOhDateByTask('qH58sm1wMr','getOhIdentifyMain')
|
|
|
+// testGetOhDetectMain('qH58sm1wMr')
|
|
|
+// testGetOmniHuman('qH58sm1wMr')
|
|
|
+// testGetOhDateByTask('qH58sm1wMr','getOmniHuman')
|
|
|
+//测试数字人接口
|
|
|
+async function testGetOhIdentifyMain() {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getOhIdentifyMain'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ headers: { 'Content-Type': 'application/json' },
|
|
|
+ method: 'POST',
|
|
|
+ mode: 'cors',
|
|
|
+ referrer: 'http://localhost:4200/',
|
|
|
+ body: JSON.stringify({
|
|
|
+ image_url: 'https://file-cloud.fmode.cn/storage/company/sV8QE3WJUS/20250723/030012209.jpg',
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+async function testGetOhDetectMain(workId) {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getOhDetectMain'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ headers: { 'Content-Type': 'application/json' },
|
|
|
+ method: 'POST',
|
|
|
+ mode: 'cors',
|
|
|
+ referrer: 'http://localhost:4200/',
|
|
|
+ body: JSON.stringify({
|
|
|
+ workId,
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+async function testGetOmniHuman(workId) {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getOmniHuman'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ headers: { 'Content-Type': 'application/json' },
|
|
|
+ method: 'POST',
|
|
|
+ mode: 'cors',
|
|
|
+ referrer: 'http://localhost:4200/',
|
|
|
+ body: JSON.stringify({
|
|
|
+ workId,
|
|
|
+ audio_url: 'https://file-cloud.fmode.cn/storage/company/UEoqWqwz8f/20251126/103708457.mp3',
|
|
|
+ prompt: '数字人朗读测试',
|
|
|
+ pe_fast_mode: false,
|
|
|
+ mask_url:[],
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+async function testGetOhDateByTask(workId, routerName, logo_info) {
|
|
|
+ let url = 'https://server.fmode.cn/api/volcengine/jimeng/getOhDateByTask'
|
|
|
+ try {
|
|
|
+ let a = await fetch(url, {
|
|
|
+ headers: { 'Content-Type': 'application/json' },
|
|
|
+ method: 'POST',
|
|
|
+ mode: 'cors',
|
|
|
+ referrer: 'http://localhost:4200/',
|
|
|
+ body: JSON.stringify({
|
|
|
+ workId,
|
|
|
+ routerName,
|
|
|
+ logo_info,
|
|
|
+ token: `Bearer r:f0333969e312a40e4703e8fe4ed1c600`
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let data = await a.json()
|
|
|
+ console.log('运行成功', data)
|
|
|
+ } catch (error) {
|
|
|
+ console.log('运行失败', error)
|
|
|
+ }
|
|
|
+}
|