手把手教你如何批量自动下载即梦 AI 生图的高清图片

目录

一、安装篡改猴(Tampermonkey)

二、在篡改猴里添加脚本

三、即梦 AI 使用

功能介绍


​​​​​​手把手教你如何批量自动下载即梦 AI 生图的高清图片icon-default.png?t=O83Ahttps://mp.weixin.qq.com/s/EvKf8P1G-hEwM0tkd7W2lQ?token=1155579505&lang=zh_CN

今天给大家分享一个超实用的技巧,能让你在下载即梦高清图片时变得超轻松!这个秘密武器就是篡改猴(Tampermonkey),它是浏览器扩展中的神器呢! 

图片

 

一、安装篡改猴(Tampermonkey)

首先,得把篡改猴安装到你的浏览器里。直接打开官网,根据自己使用的浏览器安装相应的版本。 

💡

官网:https://www.tampermonkey.net/ 

比如我用的是 Chrome,就把 crx 文件下载好,然后打开 Chrome 的扩展页,把下载好的文件拖进去,搞定! 

💡

Chrome 的文件:https://www.tampermonkey.net/crx/tampermonkey_stable.crx  

图片

二、在篡改猴里添加脚本

安装好篡改猴后,点击浏览器扩展程序中的“篡改猴”。 

图片

 

接着,点击“添加新脚本”,把我提供的脚本粘贴进去。 

图片

这一步操作完,再打开即梦 AI 生图,你会发现即梦网页的顶部多了一个下载图片的辅助工具。 

图片

 

想学习这个脚本怎么编写可以参考告别繁琐!用tampermonkey批量下载即梦HD图片文章 

批量下载即梦图片的脚本: 

版本无法使用请关注:

// ==UserScript==
// @name         下载即梦HD(webp)图片
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Collect and download specific image URLs containing aigc_resize:2400:2400 and labeled as '超清' from the page
// @match        https://jimeng.jianying.com/*
// @grant        GM_setClipboard
// @grant        GM_download
// @author       WxAiWay
// ==/UserScript==

(function() {
    'use strict';

    classImageCollector {
        constructor() {
            this.collectedUrls = [];
            this.downloadPrefix = '';
            this.startIndex = 1;
            this.copyBtn = null;
            this.downloadDelay = 1000; // 默认下载延迟
            this.isDownloading = false;
            this.progressBar = null;
        }

        init() {
            this.createControlPanel();
            this.observeImages();
        }

        decodeHTMLEntities(text) {
            const textArea = document.createElement('textarea');
            textArea.innerHTML = text;
            return textArea.value;
        }

        getImageUrl(img) {
            let src = img.getAttribute('src');
            if (src) {
                src = this.decodeHTMLEntities(src);
                if (src.includes('aigc_resize:2400:2400')) {
                    return src;
                }
            }
            returnnull;
        }

        createControlPanel() {
            const panel = document.createElement('div');
            panel.style.cssText = `
                position: fixed;
                top: 0;
                left: 50%;
                transform: translateX(-50%);
                background: white;
                border: 1px solid black;
                border-top: none;
                padding: 10px;
                z-index: 10000;
                box-shadow: 0 2px 5px rgba(0,0,0,0.2);
                border-radius: 0 0 5px 5px;
                cursor: move;
            `;

            const dragHandle = document.createElement('div');
            dragHandle.style.cssText = `
                width: 100%;
                height: 10px;
                background: #ddd;
                margin-bottom: 5px;
                cursor: move;
            `;
            panel.appendChild(dragHandle);

            const prefixInput = document.createElement('input');
            prefixInput.type = 'text';
            prefixInput.placeholder = '输入文件名前缀';
            prefixInput.style.marginRight = '5px';
            prefixInput.addEventListener('change', (e) => {
                this.downloadPrefix = e.target.value;
            });

            const startInput = document.createElement('input');
            startInput.type = 'number';
            startInput.min = 1;
            startInput.value = this.startIndex;
            startInput.placeholder = '起始索引';
            startInput.style.marginRight = '5px';
            startInput.addEventListener('change', (e) => {
                this.startIndex = parseInt(e.target.value, 10) || 1;
            });

            const delayInput = document.createElement('input');
            delayInput.type = 'number';
            delayInput.min = 100;
            delayInput.value = this.downloadDelay;
            delayInput.placeholder = '下载延迟(ms)';
            delayInput.style.marginRight = '5px';
            delayInput.addEventListener('change', (e) => {
                this.downloadDelay = parseInt(e.target.value, 10) || 1000;
            });

            const collectBtn = this.createButton('重新收集图片', () =>this.collectImages());
            const downloadBtn = this.createButton('批量下载', () =>this.downloadImages());
            this.copyBtn = this.createCopyButton();

            this.progressBar = document.createElement('div');
            this.progressBar.style.cssText = `
                width: 100%;
                height: 5px;
                background-color: #f0f0f0;
                margin-top: 5px;
                display: none;
            `;

            const progressInner = document.createElement('div');
            progressInner.style.cssText = `
                width: 0%;
                height: 100%;
                background-color: #4CAF50;
                transition: width 0.3s;
            `;
            this.progressBar.appendChild(progressInner);

            panel.appendChild(dragHandle);
            panel.appendChild(prefixInput);
            panel.appendChild(startInput);
            panel.appendChild(delayInput);
            panel.appendChild(collectBtn);
            panel.appendChild(downloadBtn);
            panel.appendChild(this.copyBtn);
            panel.appendChild(this.progressBar);

            document.body.appendChild(panel);

            this.makeDraggable(panel, dragHandle);
        }

        createButton(text, onClick) {
            const button = document.createElement('button');
            button.textContent = text;
            button.style.marginRight = '5px';
            button.addEventListener('click', onClick);
            return button;
        }

        createCopyButton() {
            returnthis.createButton(`复制URLs (${this.collectedUrls.length})`, () =>this.copyUrls());
        }

        updateCopyButtonText() {
            if (this.copyBtn) {
                this.copyBtn.textContent = `复制URLs (${this.collectedUrls.length})`;
            }
        }

        collectImages() {
            this.collectedUrls = [];
            document.querySelectorAll('.container-EdniD0').forEach(container => {
                const imgElement = container.querySelector('.image-mh68Se');
                const metaRightElements = container.querySelectorAll('.metaRight-fF8GZJ');
                const editSection = document.querySelector('.container-RBbKMJ');
                const disabledHDButton = editSection ? editSection.querySelector('.optItem-iyWnC2.disabled-R018rY') : null;

                let isHD = false;

                // 检查是否有"超清"标识
                for (const metaRight of metaRightElements) {
                    if (metaRight.textContent.trim() === '超清') {
                        isHD = true;
                        break;
                    }
                }

                // 如果没有"超清"标识,检查编辑区是否有不可用的超清按钮
                if (!isHD && disabledHDButton) {
                    const buttonText = disabledHDButton.textContent.trim();
                    if (buttonText === '超清') {
                        isHD = true;
                    }
                }

                if (isHD) {
                    let url = this.getImageUrl(imgElement);
                    if (url && !this.collectedUrls.includes(url)) {
                        this.collectedUrls.push(url);
                        console.log('收集图片URL:', url);
                    }
                }
            });
            this.showNotification(`已重新收集 ${this.collectedUrls.length} 个符合条件的图片URL`);
            this.updateCopyButtonText();
        }

        copyUrls() {
            const urlList = this.collectedUrls.join('\n');
            GM_setClipboard(urlList);
            this.showNotification(`已复制 ${this.collectedUrls.length} 个URL到剪贴板`);
        }

        downloadImages() {
            if (this.isDownloading) {
                this.showNotification('下载已在进行中');
                return;
            }

            this.isDownloading = true;
            let downloadedCount = 0;

            constdownloadNext = (index) => {
                if (index >= this.collectedUrls.length) {
                    this.isDownloading = false;
                    this.showNotification(`全部 ${this.collectedUrls.length} 张图片下载完成`);
                    this.updateProgressIndicator(0, 1); // 重置进度条
                    return;
                }

                const url = this.collectedUrls[index];
                GM_download({
                    url: url,
                    name: `${this.downloadPrefix}${this.startIndex + index}.webp`,
                    onload: () => {
                        console.log(`Downloaded: ${this.downloadPrefix}${this.startIndex + index}.webp`);
                        downloadedCount++;
                        this.updateProgressIndicator(downloadedCount, this.collectedUrls.length);
                        setTimeout(() =>downloadNext(index + 1), this.downloadDelay);
                    },
                    onerror: (error) => {
                        console.error(`Error downloading ${this.downloadPrefix}${this.startIndex + index}.webp:`, error);
                        setTimeout(() =>downloadNext(index + 1), this.downloadDelay);
                    }
                });
            };

            this.showNotification(`开始下载 ${this.collectedUrls.length} 张图片`);
            this.progressBar.style.display = 'block';
            downloadNext(0);
        }

        updateProgressIndicator(current, total) {
            const percentage = (current / total) * 100;
            const progressInner = this.progressBar.firstChild;
            progressInner.style.width = `${percentage}%`;
        }

        showNotification(message) {
            const notification = document.createElement('div');
            notification.textContent = message;
            notification.style.cssText = `
                position: fixed;
                top: 10px;
                right: 10px;
                background: rgba(0, 0, 0, 0.7);
                color: white;
                padding: 10px;
                border-radius: 5px;
                z-index: 10001;
            `;
            document.body.appendChild(notification);
            setTimeout(() => {
                notification.style.opacity = '0';
                notification.style.transition = 'opacity 0.5s';
                setTimeout(() => notification.remove(), 500);
            }, 3000);
        }

        observeImages() {
            const observer = newMutationObserver((mutations) => {
                mutations.forEach((mutation) => {
                    if (mutation.type === 'childList') {
                        mutation.addedNodes.forEach((node) => {
                            if (node.nodeType === Node.ELEMENT_NODE) {
                                const containers = node.querySelectorAll('.container-EdniD0');
                                containers.forEach(container => {
                                    const imgElement = container.querySelector('.image-mh68Se');
                                    const metaRightElements = container.querySelectorAll('.metaRight-fF8GZJ');
                                    const editSection = document.querySelector('.container-RBbKMJ');
                                    const disabledHDButton = editSection ? editSection.querySelector('.optItem-iyWnC2.disabled-R018rY') : null;

                                    let isHD = false;

                                    for (const metaRight of metaRightElements) {
                                        if (metaRight.textContent.trim() === '超清') {
                                            isHD = true;
                                            break;
                                        }
                                    }

                                    if (!isHD && disabledHDButton) {
                                        const buttonText = disabledHDButton.textContent.trim();
                                        if (buttonText === '超清') {
                                            isHD = true;
                                        }
                                    }

                                    if (isHD) {
                                        let url = this.getImageUrl(imgElement);
                                        if (url && !this.collectedUrls.includes(url)) {
                                            this.collectedUrls.push(url);
                                            console.log('收集新加载图片URL:', url);
                                            this.updateCopyButtonText();
                                        }
                                    }
                                });
                            }
                        });
                    }
                });
            });

            observer.observe(document.body, { childList: true, subtree: true });
        }

        makeDraggable(element, handle) {
            let isDragging = false;
            let startX, startY, startLeft, startTop;

            constmovePanel = (e) => {
                if (!isDragging) return;
                const dx = e.clientX - startX;
                const dy = e.clientY - startY;
                element.style.left = `${startLeft + dx}px`;
                element.style.top = `${startTop + dy}px`;
                element.style.transform = 'none'; // 移除 transform 以允许自由拖动
            };

            conststopDragging = () => {
                isDragging = false;
                document.removeEventListener('mousemove', movePanel);
                document.removeEventListener('mouseup', stopDragging);
            };

            handle.addEventListener('mousedown', (e) => {
                isDragging = true;
                startX = e.clientX;
                startY = e.clientY;
                startLeft = element.offsetLeft;
                startTop = element.offsetTop;
                document.addEventListener('mousemove', movePanel);
                document.addEventListener('mouseup', stopDragging);
            });
        }
    }

    const collector = newImageCollector();
    collector.init();
})();

三、即梦 AI 使用

使用这个工具时,要注意只收集高清的图片。所以,你需要先把确定需要的图片点击 HD,让它们变成高清模式。然后,点击已经是高清的图片,这时工具就会自动收集到下载高清图片的下载地址了。 

功能介绍

  • 第一个文本框:图片下载的前缀。你可以在这里设置一个前缀,方便你识别和管理下载的图片。
  • 第二个文本框:图片批量下载图片的起始数字。如果你已经下载了一些图片,可以从这里设置起始数字,避免重复下载。
  • 第三个文本框:每张图片下载时延时设置。这个功能可以防止因为下载速度过快而导致的网络拥堵或其他问题。

 

当原来下载过的图片不想继续收集,就可以点击“重新收集图片”,然后继续去点击你要的高清图片,工具就会自动记录起来,需要下载时,直接一键下载即可。 

图片


告别繁琐!用tampermonkey批量下载即梦HD图片

免费高效的 AI 编程助手,提升你的开发效率!

结合 AI 编写 Playwright 自动化发布视频代码,效率翻倍!

AI助力古诗视频制作全流程化教程

从图片到动画:AI 如何让静态玩具活起来?

### 即AI平台的功能与使用说明 即AI是一款专注于通过人工智能技术成高质量像、动画以及视频的工具。它能够帮助用户快速制作具有动态效果的内容,尤其适用于复古照片修复、人物动作模拟等领域。 #### 主要功能概述 即AI的核心能力在于其强大的像处理算法和自然语言理解模型[^1]。以下是该平台的主要功能: - **高精度成** 用户可以通过提供详细的描述文字来成逼真的像。这些描述应包括但不限于主体特征、背景环境、光照条件、色彩搭配及艺术风格等内容。 - **动态场景创建** 基于静态图片的基础上,用户还可以定义特定的动作指令或者行为模式,从而让原本静止的画面变得动起来。例如,在复活老照片的过程中,可以选择增加眨眼、微笑等微表情变化[^2]。 - **灵活镜头控制** 提供多种预设好的摄像机移动路径选项(俗称“运镜”),允许调整视角角度、缩放比例以及平移距离等因素,进而增强最终作品的表现力。同时支持自定义设置各项参数值以满足个性化需求。 - **高效工作流程优化** 整体操作界面简洁直观,减少了不必要的复杂环节。从素材导入到最后成品导出之间只需几个简单步骤即可完成全部任务。而且由于采用了先进的机器学习框架DeepSeek作为底层技术支持,因此整个渲染过程非常迅速稳定。 #### 使用指南概览 为了更好地利用上述提到的各项特性,这里给出一些基本的操作指导建议: 当准备开始创作之前,请先思考清楚希望达成什么样的视觉目标,并据此撰写详尽的文字脚本。对于每一个独立的对象单元都要尽可能多地补充相关信息,比如它的外观形态、所处位置关系以及其他关联属性等等。 随后按照界面上方引导提示依次执行如下动作:上传基础源文件;填写对应的标签关键词列表;设定预期活动范围边界限制;挑选适合当前情境使用的模板样式类别;最后确认无误之后提交请求等待计算完毕返回结果数据包下载链接地址。 值得注意的是,在实际应用当中如果发现某些局部细节不够理想的话,则可以尝试修改原初输入语句重新运行程序直至满意为止。另外记得合理调节时间轴上的播放速率数值以免造成观感不适现象发。 ```python # 示例代码片段展示如何调用API接口实现自动批量产任务 import requests def generate_image(prompt, style="realistic"): url = "https://api.imagineai.com/v1/generate" headers = {"Authorization": "Bearer YOUR_ACCESS_TOKEN"} payload = { "prompt": prompt, "style": style } response = requests.post(url, json=payload, headers=headers) if response.status_code == 200: image_url = response.json()["image_url"] return image_url else: raise Exception(f"Error generating image: {response.text}") example_prompt = "A futuristic cityscape under neon lights with cyberpunk aesthetics." generated_image_link = generate_image(example_prompt) print(generated_image_link) ```
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值