This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import bpy | |
output = None | |
input = None | |
info = None | |
error = None | |
write = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def forward(self, x, timesteps=None, context=None, y=None, **kwargs): | |
# broadcast timesteps to batch dimension | |
timesteps = timesteps.expand(x.shape[0]) | |
hs = [] | |
t_emb = get_timestep_embedding(timesteps, self.model_channels) # , repeat_only=False) | |
t_emb = t_emb.to(x.dtype) | |
emb = self.time_embed(t_emb) | |
assert x.shape[0] == y.shape[0], f"batch size mismatch: {x.shape[0]} != {y.shape[0]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from bpy.types import Panel, EnumProperty, WindowManager | |
import bpy.utils.previews | |
import os | |
# UI | |
class PreviewsExamplePanel(bpy.types.Panel): | |
bl_label = "Previews Example Panel" | |
bl_idname = "OBJECT_PT_previews" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
installation | |
- from a fresh Blender start | |
- drop ufkoot.py into your scripts/addons(_contrib) folder | |
- in User Preferences / addons / Testing (or community..) / Development | |
- tick 'Info To Text' | |
- press Save User Settings | |
- close the User Preferences Panel | |
- press Ctrl + U , (this will store this preference in the startup.blend) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ##### BEGIN GPL LICENSE BLOCK ##### | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# huggingface login | |
from huggingface_hub import login | |
login() | |
# load textencorder in 8bit quantized | |
from transformers import T5EncoderModel | |
from diffusers import DiffusionPipeline | |
import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ran it with the following packages installed: | |
# accelerate 0.18.0 | |
# diffusers 0.16.0.dev0 | |
# torch 2.0.0+cu118 | |
# torchvision 0.15.0+cu118 | |
# transformers 4.28.1 | |
# xformers 0.0.18 | |
import torch | |
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for http://blender.stackexchange.com/questions/58486/add-toggle-hotkey-to-custom-checkbox | |
bl_info = { | |
"name": "Add-on Template", | |
"description": "", | |
"author": "poor", | |
"version": (0, 0, 2), | |
"blender": (2, 70, 0), | |
"location": "3D View > Tools", | |
"warning": "", # used for warning icon and text in addons panel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for http://blender.stackexchange.com/questions/44886/search-enum-list | |
bl_info = { | |
"name": "Search Popup", | |
"version": (0, 0, 1), | |
"blender": (2, 75, 0), | |
"category": "Test" | |
} | |
import bpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for http://blender.stackexchange.com/q/73858/3710 | |
import bpy | |
import os | |
def image_sequence_resolve(operator, context): | |
filepath = context.space_data.clip.filepath | |
filepath_full = bpy.path.abspath(filepath) | |
NewerOlder