Skip to content

Instantly share code, notes, and snippets.

@blaswan
blaswan / bootstrap-flux.sh
Last active April 28, 2026 09:47
FLUX.1 schnell RunPod bootstrap script (LDV PoC)
#!/bin/bash
# FLUX.1 schnell RunPod 부트스트랩 (LDV PoC)
# 사용법: curl -sSL https://gist.githubusercontent.com/blaswan/<bootstrap-gist-id>/raw/bootstrap-flux.sh | bash
set -e
HANDLER_URL="https://gist.githubusercontent.com/blaswan/c78f11b64e24c27d5c1cdc4bdb9daf5b/raw/runpod-handler.py"
echo ""
echo "=========================================="
@blaswan
blaswan / runpod-handler.py
Created April 28, 2026 09:36
FLUX.1 schnell RunPod handler (LDV PoC)
"""
FLUX.1 schnell self-hosted FastAPI handler for RunPod Pod (RTX 4090 / L40S).
Spec: api-contract.md v0.1.
Tested approach (선택 근거):
- diffusers 직접 사용. ComfyUI는 워크플로우 JSON 의존성 + 디버깅 비용 큼. 단순 1엔드포인트 PoC는 diffusers가 빠름.
- bf16 (4090 권장). FLUX.1 schnell 공식 dtype.
- xformers attention 미사용 (FLUX는 sdpa 기본 충분).
- offload 안 함 (4090 24GB로 schnell + bf16 충분히 fit).
export const assert = (condition: boolean, messageOrError?: string | Error) => {
if (!condition) {
if (typeof messageOrError === "string" || typeof messageOrError === "undefined") {
const message = messageOrError || "Assertion failed";
if (typeof Error !== "undefined") {
throw new Error(message);
}
} else {
throw messageOrError;
}
<!-- Salesboost 시작 -->
<script>
var FB_PIXEL_ID = 'YOUR_PIXEL_ID';
var FB_CURRENCY = 'KRW';
!function(w,d,s,u,t,e){t=d.createElement(s);t.async=!0;t.src=u;
e=d.getElementsByTagName(s)[0];e.parentNode.insertBefore(t,e)}(window,
document,'script','https://cdn.salesbooster.io/sdk/cafe24/web.min.js')
</script>
<!-- Salesboost 끝 -->
<!-- Start Channel Plugin -->
<script>
window.channelPluginSettings = {
"plugin_id": '${YOUR_PLUGIN_ID}'
};
(function() {
var node = document.createElement('div');
node.id = 'ch-plugin';
document.body.appendChild(node);
var async_load = function() {
@blaswan
blaswan / ch-plugin-script-future-shop.html
Last active August 23, 2017 02:51
構築メニュー → プロモーション管理 →任意アフィリエイト設定
<!-- Start Channel Plugin -->
<script>
window.channelPluginSettings = {
"plugin_id": '${YOUR_PLUGIN_ID}'
};
if ('$MEMBER_ID$' !== undefined && '$MEMBER_ID$' !== '' && '$MEMBER_ID$' !== null) {
window.channelPluginSettings.user = {
id: '$MEMBER_ID$',
meta: {}
};
address,
article,
aside,
blockquote,
canvas,
center,
dd,
details,
dir,
div,
<!-- Channel Plugin Scripts -->
<script>
window.channelPluginSettings = {
"plugin_id": "YOUR_PLUGIN_ID"
};
<!--{? userInfo.member_seq }-->
window.channelPluginSettings.user = {
'id': '{userid}',
'name': '{user_name}',
'mobileNumber': '{cellphone}',
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
ChannelPlugin.initialize(this, pluginKey);
// ChannelPlugin.initialize(this, pluginKey, true); // for debug
}
}
<application
android:name="com.example.MyApplication"
...
>
...
<provider
android:name="com.zoyi.channel.plugin.android.global.ChannelFileProvider"
android:authorities="your.package.ch_provider"
android:exported="false"
android:grantUriPermissions="true">