Code Monkey home page Code Monkey logo

Comments (5)

OedoSoldier avatar OedoSoldier commented on May 19, 2024

用 Files to process 指定就行了

from sd-webui-image-sequence-toolkit.

souvenp avatar souvenp commented on May 19, 2024

用 Files to process 指定就行了

我输入了输入文件夹的某一个文件名,扩展名删掉也试了都会出现FileNotFoundError错误
line 220, in run
raise FileNotFoundError

from sd-webui-image-sequence-toolkit.

OedoSoldier avatar OedoSoldier commented on May 19, 2024

用 Files to process 指定就行了

我输入了输入文件夹的某一个文件名,扩展名删掉也试了都会出现FileNotFoundError错误 line 220, in run raise FileNotFoundError

只处理一张要用 文件名-文件名 的形式

from sd-webui-image-sequence-toolkit.

souvenp avatar souvenp commented on May 19, 2024

用 Files to process 指定就行了

我输入了输入文件夹的某一个文件名,扩展名删掉也试了都会出现FileNotFoundError错误 line 220, in run raise FileNotFoundError

只处理一张要用 文件名-文件名 的形式

00001.png-00001.png或者00001.png-00002.png
我按了这个输入的,是输入文件夹的图片,还是报那个错用逗号也一样

from sd-webui-image-sequence-toolkit.

souvenp avatar souvenp commented on May 19, 2024

我参考chatgpt修改了这部分代码,运行是可以的, 只做了一种情况,就是单个文件名,从这个文件处理到结束。
就是这里下标[2]才是开始处理的图片,有点怪但是不影响把
reference_imgs = [images_in_folder_dict[start - interval_img], images_in_folder_dict[max(0, start - interval_img)]] + images

if given_file:
            images = []
            images_in_folder = [os.path.join(input_dir, f) for f in os.listdir(input_dir) if re.match(r'.+\.(jpg|png)$', f)]
            try:
                images_idx = [int(re.findall(re_findidx, j)[0]) for j in images_in_folder]
            except BaseException:
                images_idx = [re.findall(re_findname, j)[0] for j in images_in_folder]
            images_in_folder_dict = dict(zip(images_idx, images_in_folder))
            sep = ',' if ',' in specified_filename else ' '
            print("aaaaaaaaaaaaa")
            print(images_idx)
            images_idx = sorted(images_idx)
            interval_img = images_idx[1] - images_idx[0]
            start = None
            print(images_in_folder_dict.values())
            for i in specified_filename.split(sep):
                for value in images_in_folder_dict.values():
                    if i in value:
                        images.append(value)
                        print("ddddddddddddddd")
                        if len(specified_filename.split(sep)) == 1:
                            end = images_idx[-1]
                        else:
                            end = i
                        if not start:
                            start = i
                else:
                    try:
                        match = re.search(r'(^\d*)-(\d*$)', i)
                        if match:
                            start, end = match.groups()
                            if start == '':
                                start = images_idx[0]
                            if end == '':
                                end = images_idx[-1]
                            images += [images_in_folder_dict[j] for j in list(range(int(start), int(end) + 1))]
                    except BaseException:
                        try:
                            images.append(images_in_folder_dict[int(i)])
                        except KeyError:
                            pass
            if len(images) == 0:
                raise FileNotFoundError(f"No valid image found in specified file: {specified_filename}")
            start = int(start.split('.')[0].lstrip('0'))
            if isinstance(end, int):
                end = str(end)
            end = int(end.split('.')[0].lstrip('0'))
            images += [images_in_folder_dict[j]
                for j in list(range(int(start + interval_img), int(end) + interval_img, interval_img))]
            
            reference_imgs = [images_in_folder_dict[start - interval_img], images_in_folder_dict[max(0, start - interval_img)]] + images
            history_imgs = [images_in_folder_dict[images_idx[0]], images_in_folder_dict[max(images_idx[0], start - 2*interval_img)], images_in_folder_dict[max(0, start - interval_img)]]
            history_imgs = [images_in_folder_dict[images_idx[0]]] + [os.path.join(output_dir, os.path.basename(f)) for f in history_imgs]`
```

from sd-webui-image-sequence-toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.